Microsoft Power BI Complete Reference
上QQ阅读APP看书,第一时间看更新

Percentage of total calculation

Now, create another calculated measure on the Internet Sales table using the following code. Make sure that you format the measure as a percentage:

% of All Countries = DIVIDE([Total Sales], [Total Sales all Countries])

In the following screenshot, you can see the completed example with both of the new measures created in this section. Without a basic understanding of the CALCULATE function, this type of percent of total calculation would be nearly impossible: 

Figure 16- Completed example with both of the new measures