Created
October 15, 2016 11:39
-
-
Save deldersveld/9a29994389928267372eb8ed80691fcb to your computer and use it in GitHub Desktop.
Some DAX snippets for % of Grand Total
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Single measure version | |
% of Total = DIVIDE(SUM('Sales'[Revenue]), CALCULATE(SUM('Sales'[Revenue]), ALLSELECTED('Product'[Category]))) | |
//As traced in Power BI Quick Calc "% of Grand Total" | |
EVALUATE | |
TOPN( | |
1001, | |
SUMMARIZECOLUMNS( | |
'Product'[Category], | |
"M0", CALCULATE( | |
DIVIDE(SUM('Sales'[Revenue]), CALCULATE(SUM('Sales'[Revenue]), ALLSELECTED('Product'[Category]))) | |
) | |
), | |
'Product'[Category], | |
1 | |
) | |
ORDER BY | |
'Product'[Category] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment