Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear,
I have been able to put together a table showing top 20 values per service line such as in the example below:
Service Line | Top 20 amounts |
A | 100.000 |
B | 200.000 |
C | 300.000 |
D | 250.000 |
Total | 850.000 |
Formula for measure Top 20 amounts =
Service Line | Top 20 overall |
A | 0 |
B | 250.000 |
C | 350.000 |
D | 0 |
Total | 600.000 |
I tried this formula to obtain this but this doesn't ignore the row context of the service lines:
Can anyone help me to change my first formula so that the top 20 would be recalculated to ignore the row context of service lines?
Thank you!
Best regards,
Solved! Go to Solution.
Hi @Anonymous ,
The All() function in the rankx() function should be all ('Rap + Transactions') to ignore all filters in the table instead of specific columns. Please try to modify it as follows:
Top 20 overall =
CALCULATE (
[WIP+ 2020 per project],
ALL ( 'Rap+Transactions'[Service Line] ),
FILTER (
VALUES ( 'Rap+Transactions'[Project] ),
IF (
RANKX ( ALL ( 'Rap+Transactions' ), [WIP+ 2020 per project],, desc ) <= 20,
[WIP+ 2020 per project],
BLANK ()
)
)
)
And I have create a sample measure that you can refer:
Top20 overall =
VAR top20 =
CALCULATE (
[WIP+ 2019 per project],
FILTER (
'Table',
IF (
RANKX ( ALL ( 'Table' ), [WIP+ 2019 per project],, DESC ) <= 20,
[WIP+ 2019 per project],
BLANK ()
)
)
)
RETURN
IF ( ISBLANK ( top20 ), 0, top20 )
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
The All() function in the rankx() function should be all ('Rap + Transactions') to ignore all filters in the table instead of specific columns. Please try to modify it as follows:
Top 20 overall =
CALCULATE (
[WIP+ 2020 per project],
ALL ( 'Rap+Transactions'[Service Line] ),
FILTER (
VALUES ( 'Rap+Transactions'[Project] ),
IF (
RANKX ( ALL ( 'Rap+Transactions' ), [WIP+ 2020 per project],, desc ) <= 20,
[WIP+ 2020 per project],
BLANK ()
)
)
)
And I have create a sample measure that you can refer:
Top20 overall =
VAR top20 =
CALCULATE (
[WIP+ 2019 per project],
FILTER (
'Table',
IF (
RANKX ( ALL ( 'Table' ), [WIP+ 2019 per project],, DESC ) <= 20,
[WIP+ 2019 per project],
BLANK ()
)
)
)
RETURN
IF ( ISBLANK ( top20 ), 0, top20 )
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Withouth any data is difficult to give you an exact answer, however SQLBI released a video with a TOPN usage for the that can be adjusted to your calculation.
If you have any issues in adjusting this can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |