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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors