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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

showing Wrong Totals

Hi guys,

 

Table visualization showing the wrong total, please anybody suggest me how to resolve this one.

 
Total Sales = SUM(financials[ Sales])
Rank Selection = IF(SELECTEDVALUE('Rank'[Rank No]), VALUES('Rank'[Rank No]),"Please select any rank")
Rankx = IF(HASONEVALUE(financials[Month Name]),RANKX(ALL(financials[Month Name]),[Total Sales],,DESC),BLANK())
Sale = IF([Rankx] <= [Rank Selection],[Total Sales],BLANK())

 

Rank.JPG

regards,

Naveen

1 ACCEPTED SOLUTION
Anonymous
Not applicable

hi Guys

 

I changed the final measure it's working

 

Sale = SUMX(VALUES(financials[Month Name]),IF([Rankx] <= [Rank Selection],[Total Sales],BLANK()))

 Rank.JPG

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

You need to take care of the row context.  Summarize or Values should help

Example

sumX(summarize(financials,financials[Month Name], "_sum",IF([Rankx] <= [Rank Selection],[Total Sales],BLANK())),[_sum])

 

Refer

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451

Anonymous
Not applicable

hi Guys

 

I changed the final measure it's working

 

Sale = SUMX(VALUES(financials[Month Name]),IF([Rankx] <= [Rank Selection],[Total Sales],BLANK()))

 Rank.JPG

Greg_Deckler
Super User
Super User

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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