Forum Discussion
Power BI TOP N
- 6 years ago
Hi , Anonymous
Here is a demo.
You need to create a calculate column first:
Row Number = COUNTROWS(FILTER('Table','Table'[Amount Dollar]>=EARLIER('Table'[Amount Dollar])))Enter Table as below:
Then create the measure "pecentage by amount" as below :
Measure = VAR _topn = SELECTEDVALUE ( 'Table 2'[TOP N] ) VAR tab = TOPN ( _topn, 'Table', 'Table'[Amount Dollar] ) RETURN DIVIDE ( SUMX ( tab, 'Table'[Amount Dollar] ), CALCULATE ( SUM ( 'Table'[Amount Dollar] ), ALL ( 'Table' ) ) )The result will show as below:
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear v-easonf-msft thank you for ask this question.sorry for my question not clear.
this is my sample data i created. Please kindly check it.
my method that i tried:
1. i create measure for sum amount.
2. i create rank measure
https://jia666-my.sharepoint.com/:x:/g/personal/khihortmrm_xkx_me/Ed_SHMrOvjFJiyBWhXMObRkB2bu9MmT0Lsj79gK_-5_Oyg?e=082YTB
thank you in advance.
Hi , Anonymous
Here is a demo.
You need to create a calculate column first:
Row Number = COUNTROWS(FILTER('Table','Table'[Amount Dollar]>=EARLIER('Table'[Amount Dollar])))Enter Table as below:
Then create the measure "pecentage by amount" as below :
Measure =
VAR _topn =
SELECTEDVALUE ( 'Table 2'[TOP N] )
VAR tab =
TOPN ( _topn, 'Table', 'Table'[Amount Dollar] )
RETURN
DIVIDE (
SUMX ( tab, 'Table'[Amount Dollar] ),
CALCULATE ( SUM ( 'Table'[Amount Dollar] ), ALL ( 'Table' ) )
)The result will show as below:
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.