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
sivarajan21
Post Patron
Post Patron

Dax measure not returning the correct aggregate result

Hi,

 

I created this measure shown below that returns a table with correct row values:

sivarajan21_0-1715879627103.png

But the aggregate total -3036.53 is not correct  and correct total we need is -1145.19.

Could you please help me as what needs to be corrected in the above measure for the correct total?

 

PFA file here Portfolio Performance - v2.12 - Copy (2).pbix

 

Thanks in advance!

@Ahmedx @Greg_Deckler @marcorusso @amitchandak @v-jianpeng-msft 

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

@sivarajan21 

Try it using TOPN instead.

Budget Carbon Variance Bottom 20 v2 = 
 VAR _TopN = TOPN(10,ALL(Contacts[Name]),[Budget Carbon Variance],ASC)
  RETURN
CALCULATE([Budget Carbon Variance],KEEPFILTERS(_TopN))

jdbuchanan71_0-1715881539929.png

 

View solution in original post

Ahmedx
Super User
Super User

4 REPLIES 4
Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Greg_Deckler
Super User
Super User

@sivarajan21 First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

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

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8


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...
jdbuchanan71
Super User
Super User

@sivarajan21 

Try it using TOPN instead.

Budget Carbon Variance Bottom 20 v2 = 
 VAR _TopN = TOPN(10,ALL(Contacts[Name]),[Budget Carbon Variance],ASC)
  RETURN
CALCULATE([Budget Carbon Variance],KEEPFILTERS(_TopN))

jdbuchanan71_0-1715881539929.png

 

Arul
Super User
Super User

@sivarajan21 ,

I am unable to download the file, but please refer to these two videos. They should help you understand the context behind the Grand Total issue and its solution.

https://www.youtube.com/watch?v=yw0QHu9V4UQ

https://www.youtube.com/watch?v=ufHOOLdi_jk&app=desktop&ab_channel=Curbal





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
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.