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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ROOY1
Regular Visitor

Matrix with Measure doesn't SUM

Hello all,

 

I made a Measure but i am not receiving the expected results on my martix visual in PBI. 

I want for every staff member who is ZZP or Charter and drove 1 or more orders on a day a 1 and not a count since we are intressted in FTE and not the amout of orders.

 

Aantal extern test =

VAR CurrentDate = SELECTEDVALUE(RITDETAILS[DATUM])      
VAR CurrentStaffNum = SELECTEDVALUE(Ritdetails[StaffNumber])

RETURN
IF(CALCULATE(COUNTROWS(Ritdetails), FILTER(Ritdetails, Ritdetails[Transporteur] = "ZZP" || Ritdetails[Transporteur] = "Charter" && Ritdetails[StaffNumber] = CurrentStaffNum && Ritdetails[Datum] = CurrentDate)) >=1, 1, BLANK())
 
ROOY1_0-1712844052521.png

Here you can see that the total of 01-04-2024 is showing 1 but I expect here the sum so 4.

 
I hope that someone can help me with this situation.
Cheers Roy
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ROOY1 ,

I created the sample data myself but both row and column subtotals work fine, unfortunately I can not reproduce your problem.

vhuijieymsft_0-1713407403891.png

 

I can not help you very well. Maybe you can provide me with your pbix file?

 

Please remove sensitive data and do not log in to your account in Power BI Desktop when uploading pbix files.

 

All this is to better solve your problems.

 

I would be grateful if you get back to me quickly.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ROOY1 ,

 

Thanks for the reply from Greg_Deckler , please allow me to provide another insight:

 

Please modify your measure syntax:

Aantal Extern Test Revised = 
SUMX(
    VALUES(RITDETAILS[DATUM]),
    VAR CurrentDate = RITDETAILS[DATUM]
    VAR CurrentStaffNum = SELECTEDVALUE(Ritdetails[StaffNumber])
    RETURN
        IF(
            CALCULATE(
                COUNTROWS(Ritdetails), 
                FILTER(
                    Ritdetails, 
                    Ritdetails[Transporteur] IN {"ZZP", "Charter"} 
                    && Ritdetails[StaffNumber] = CurrentStaffNum 
                    && Ritdetails[Datum] = CurrentDate
                )
            ) >= 1, 
            1, 
            BLANK()
        )
)

 

If it does not work after modification, please provide me with sample data, please remove any sensitive data in advance.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Hi Yang,

 

 I have tried your modification and here is the result: 

ROOY1_0-1713356181117.png

Now column subtotals are working but row subtotals are not working yet :(.

Anonymous
Not applicable

Hi @ROOY1 ,

I created the sample data myself but both row and column subtotals work fine, unfortunately I can not reproduce your problem.

vhuijieymsft_0-1713407403891.png

 

I can not help you very well. Maybe you can provide me with your pbix file?

 

Please remove sensitive data and do not log in to your account in Power BI Desktop when uploading pbix files.

 

All this is to better solve your problems.

 

I would be grateful if you get back to me quickly.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Greg_Deckler
Community Champion
Community Champion

@ROOY1 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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