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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
HenrikH29
Advocate I
Advocate I

Wrong Sum totals when using measures in a matix

I have two measures in a matix. One showing negative values and one showing positive values. 

 

However i can't get a total in each coloumn. I one get ne total and it's the sum of both measures.

 

The measures are:

Foran = IF(CALCULATE( [Produktion 60 dg.] - [Netto IVA] )>=0;CALCULATE( [Produktion 60 dg.] - [Netto IVA]);BLANK())

and

Bagud = IF(CALCULATE( [Produktion 60 dg.] - [Netto IVA] )<0;CALCULATE( [Produktion 60 dg.] - [Netto IVA]);BLANK())

 

Udklip.JPG

 

I've Googled and found that i probably have to use SUMX or HASONEVALUE but i can't figure the syntax out.

 

Any help constructing the syntax would be appreciated.

4 REPLIES 4
himanshu56
Resolver II
Resolver II

Hi @HenrikH29

 

Please use the following DAX :

Foran = SUMX ( TableName,  IF(CALCULATE( [Produktion 60 dg.] - [Netto IVA] )>=0;CALCULATE( [Produktion 60 dg.] - [Netto IVA]);BLANK()) )

 

Similarly create for Bagud.

 

This should work...

 

Thanks,

Himanshu

Hi Himanshu

 

Thanks for your quick reply

 

The syntax dosn't generate an error, however the clculated resultats are not correct.

 

"TableName" is to be substituted with the tablename that holds the measures - right?

 

"Produktion 60 dg" is calculated this way : Produktion 60 dg. = CALCULATE(Sum(DSP_SAGPOST[Igang. arb.]);Kalender[Dato]>=TODAY()-60)

 

and Netto IVA = CALCULATE(sum(DSP_SAGPOST[Igang. arb.]))-CALCULATE(SUM(DSP_SAGFAKGEM[Aconto]))

 

This is the resulat i get using your suggestion:

Udklip.JPG

In my previous posting you can se the correct results (but with incorrect totals).

 

Any ideas?

Check out if a label works correctly. If not, try using "0" instead of BLANK to complete the areas.

Regards


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

Happy to help!

LaDataWeb Blog

Tried using "0" instead of BLANK() but wtihout any luck.

 

There's one dealing with it here, but I just can't get the syntax right trying his solution.

 

http://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/m-p/63376

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors