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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Uzi2019
Super User
Super User

Incorrect measure total in Matrix

Hi Experts,
@Greg_Deckler 
I have tried using summarize, sumx and hasonevalue function still giving incorrect result in total. I have used 3 different measure which I have written below

Measure 1 (getting week days)
Datediff =
VAR Start = MIN('Table'[DATE])
VAR End = MAX('Table'[END_DATE])
RETURN DATEDIFF(Start,End,DAY)+1

 

Measure 2

%sum = SUM('Table'[sum])/CALCULATE(SUM('Table'[sum]]),ALLSELECTED())

 

Measure 3
Final=
Var A= 300000/Last day of the month 
Var B= A*( Datediff)
Var C =A*B
Var D= C*(%sum)
return D
I want to show  Final measure in matrix visual agianst month, week and category dimension. Row wise data is showing correctly but at total showing incorrect data.

Uzi2019_0-1632131959490.png

 

I

I want answer to be 2032819+544684=2577503 for

Any help would be appreciated.

Thank you in advance.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Uzi2019 , Try to use something like below:

IF(HASONEFILTER('Table'[Month]),C*(%Sum),SUMX(VALUES('Table'[Month]),C*(%Sum)))
 
Hopefully it may help you out.
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

8 REPLIES 8
Tahreem24
Super User
Super User

@Uzi2019 , Try to use something like below:

IF(HASONEFILTER('Table'[Month]),C*(%Sum),SUMX(VALUES('Table'[Month]),C*(%Sum)))
 
Hopefully it may help you out.
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 

I got my total corretly. thank you so much.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Greg_Deckler
Super User
Super User

@Uzi2019 So, based on 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, you are really going to need something like MM3TR&R. Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community

 

Assuming that you have a measure that is working at the month and week levels, I imagine it would be something like:

Measure Total = 
  VAR __CurrentCount = COUNTROWS('Table')
  VAR __AllCount = COUNTROWS(ALLSELECTED('Table'))
  VAR __Total = SUMX('Table',[Month],"__Measure",[This is your existing measure])
RETURN
  IF(__CurrentCount = __AllCount,__Total,[This is your existing measure])

@ 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...
selimovd
Super User
Super User

Hey @Uzi2019 ,

 

what exactly should the result be?

Can you provide a sample file? It's a little difficult to help you with that small amount of information.

 

Best regards

Denis

Hi @selimovd ,
I want answer to be 2032819+544684=2577503 for final measure

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

@Uzi2019 Can you share the file or create a sample file if the content is confidential? 

Hi @selimovd 

Uzi2019_0-1632132133647.png

sorry but cant share the file it has confidential data.
can u help me by looking at this image? or suggest some measure which gives correct total.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

@Uzi2019 it looks like it could be semi additive values, but you have to share more information.

 

If the data is confidential, then please create a similar file with fake data and the same behavior. But if you just say "look, it's wrong" and don't provide more information I don't know what to tell you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.