Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Why am i getting the output like this
pls try this -
The issue you're encountering with the RANKX function in Power BI is likely due to the way the function is being used in conjunction with the ALL function. The ALL function removes all filters from the specified columns or tables, which can cause the RANKX function to rank all values as 1 because it is not considering any context for the ranking.
To fix this, you need to ensure that the RANKX function is applied in a context that allows it to rank the values correctly.
DAX
RankX = RANKX(
ALL('Calendar'[Date], 'Calendar'[Quarter]),
[Total],
,
DESC,
DENSE
)
Proud to be a Super User! |
|
I'm still getting incorrect result.Also if we do as you mentioned, won't the virtual table contain all possible combinations of year and quarter. The rank would be assigned as per its position in this entire set right
Hi @Cyriackpazhe , hello bhanu_gautam, thank you for your prompt reply!
Please try the following measure:
MeasureTotal = SUM('Table'[Total])
RankX =
IF (
ISINSCOPE ( 'Table'[Date].[Quarter] ),
RANKX (
FILTER (
ALL('Table') ,
YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
),[MeasureTotal],,DESC
,
DENSE
),
IF (
ISINSCOPE ( 'Table'[Date].[Year] ),
RANKX (
ALL ( 'Table' ),
CALCULATE (
SUM ( 'Table'[Total] ),
ALLEXCEPT ( 'Table', 'Table'[Date].[Year] )
),
[MeasureTotal],
DESC,
DENSE
),
BLANK ()
)
)
Result:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
but why isn't the meausre i wrote working. It should be correct right
Hi @Cyriackpazhe , thank you for your feedback.
If possible, please update the sample pbix file without any sensitive information for further troubleshooting.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |