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
Parthsh93
Helper IV
Helper IV

Correct measur for right Totals

I am getting wrong totals.

I want the formula to work as summing the derived column values through the measure and it should work correctly with any filter is put by clicking on my dashboard.
Here in the image, the shown values of "Trips saved VS last month with Total" and "Savings from Loadability VS LM"  are the only values and the totals of these values are not correct if you tally.

 

Column totals wrong.PNG

 

 

 

 

 

 

 

 

Trips saved VS last Month With Total = 
SUMX(
    VALUES(dDate[YearMonth]),
CALCULATE(
    IF(
        [0_Total Volume Shipped by Cases]=0 || [last month loadability BCPT]=0,
        BLANK(),
        DIVIDE([0_Total Volume Shipped by Cases],[last month loadability BCPT],BLANK())-[0_Total Shipments])))
Loadability by cases per trips = CALCULATE(DIVIDE([0_Total Volume Shipped by Cases],[0_Total Shipments],BLANK()))
last month loadability BCPT = CALCULATE([Loadability by cases per trips],DATEADD(dDate[Date],-1,MONTH))
0_Total Shipments = COUNTX('Prototype Modeling_Freight','Prototype Modeling_Freight'[Sold Cases])
_Average Cost Per Freight = DIVIDE([Cost of Freight],[0_Total Shipments],0)
Savings From Loadability VS LM = SUMX(VALUES(dDate[YearMonth]),[_Average Cost Per Freight]*[Trips saved VS last Month With Total])

 

 

 

 

 

 

 

 

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi @Parthsh93

 

Can you upload your sample .pbix file via onedrive business and share the link with us?

Much appreciated.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

amitchandak
Super User
Super User

@Parthsh93 , You need to provide a row context to it

 

Try like

Savings From Loadability VS LM  new=
sumx(summarize(table, table[Month], "_1",[Savings From Loadability VS LM]),[_1])

Thank you for replying @amitchandak ,

but what you have suggested, I am not able to understand.

The whole concept of summurize is unclear to me, I have tried reading about it but I just dont understand the language.

 

@Parthsh93 , Try to calculate the measure at month level and doing sum after that. Measure recalculate the grand total.  So forcing it to sum it up from Month level

 

This like first group data at Month level and then use again

Summarize will create in-memory table and "_1"  an in-memory column

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.