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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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


Follow on LinkedIn
@ 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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