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
mb0307
Responsive Resident
Responsive Resident

In Matrix table, total is not correct

Hi,

Total in matrix table is not showing correct, as value is shown through measure. How can i achieve this correct result.

 

measure is 

 

SalesNProjectsales=

VAR _Currentmnth =MONTH(DATE(YEAR(TODAY(),MNTH(TODAY(),1)-1)

VAR _AMOUNT =IF(MONTH(MAX(dates[Date]))<=_Currentmnth,

[sales amount],

[avg monthly sales])

return

_amount

 

 

scenario

 

We have sales table , dates table , customer table. To calculate the Project sales we have made summarize table of customer and sales, which give us avg monthly sales.

 

 

 

I want to display a matrix chart showing customer and month on axises and amount. iam using measure to display sales amount which is from jan to aug month and pedicted amount which from sep to dec month. Total is not showing correct

 

Customer JanFebMarAprMayJunJulAugSepOctNovDecTotal
A101044410101010272.2972.2972.2972.29795.1429
B2022220652056202063.2963.2963.2963.29696.1429
C101010781010231023.0023.0023.0023.00253
D30330303030305433.8633.8633.8633.86372.4286
              
total70245504183701068386192.4286192.4286192.4286192.4286

Thanks 

 

 

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @mb0307 ,

 

You may create measure like DAX below.

 

Measure_New=

var _table = SUMMARIZE(Table1, Table1[Customer],"_Value", [SalesNProjectsales] )

return
IF(HASONEVALUE(Table1[Customer]), [SalesNProjectsales], SUMX(_table,[_Value]))

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @mb0307 ,

 

You may create measure like DAX below.

 

Measure_New=

var _table = SUMMARIZE(Table1, Table1[Customer],"_Value", [SalesNProjectsales] )

return
IF(HASONEVALUE(Table1[Customer]), [SalesNProjectsales], SUMX(_table,[_Value]))

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@mb0307 , Try to change return like

return sumx(values(Table[customer]),_amount)

Greg_Deckler
Super User
Super User

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