Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to get Total for a measure column or an alternate DAX solution? Rank of Total for selected item.

How to get this measure on the card total? I am only looking to get 27 on card visual but it comes blank. I tried aggregation on top of this "Rank Ongoing Selected" but it did not work. 

 

I am looking to show Rank of Avg Ongoing Cost where Z_highlight = 1. There are also slicer changing the filter context hence I am using ALLSELECTED for Rank. 

 

Avg Ongoing Ranking 1 = RANKX(FILTER(ALLSELECTED(ValueMoney[Fund Provider]),
NOT(ISBLANK(ValueMoney[avg ongoing cost]))),
[avg ongoing cost],,ASC)
 
Rank Ongoing Selected = VALUE( IF([Z_Highlight] = 1, RANKX(FILTER(ALLSELECTED(ValueMoney[Fund Provider]),
NOT(ISBLANK(ValueMoney[avg ongoing cost]))),
[avg ongoing cost],,ASC), BLANK()))
 
Untitled.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I just found the solution, sharing for the community. The final step was to get Rank 27 from the last column onto the card. I am using the below DAX to create a final summary of the last column.

 

Avg Ranking Ongoing Cost Sum = CALCULATE(SUMX(VALUES(ValueMoney[Fund Provider]),
[Rank Ongoing Selected]),ALLSELECTED(ValueMoney))

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I just found the solution, sharing for the community. The final step was to get Rank 27 from the last column onto the card. I am using the below DAX to create a final summary of the last column.

 

Avg Ranking Ongoing Cost Sum = CALCULATE(SUMX(VALUES(ValueMoney[Fund Provider]),
[Rank Ongoing Selected]),ALLSELECTED(ValueMoney))
Anonymous
Not applicable

Thanks for the response Amit. but if we use ALL in RANK then we will lose the filter context set by the slicers. There are slicers on page that reduces the data set to few brands only. Rank is calculated based on selected values.

@Anonymous , That is a problem, when selecting a brand in visual,  you have only that brand. so allselected will be given Rank 1.

Interaction off - it will not work

removefilters, all I tried a few more combinations, but they remove the brand from the context. So did not work for me.

Wait for other users to provide some solution

 

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Anonymous , assume you create a rank like

Rank Brand = Rankx(ALL('Item'[Brand]),[Net]) // using all

 

Then this measure can give selected rank for brand

Rank M = maxx(VALUES('Item'[Brand]), [Rank Brand])

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.