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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
HALEYSTODDARD
Frequent Visitor

SUMX not totaling correctly! PLEASE HELP

HELP!

 

My Measure = 

= SUMX(
    VALUES(Dates[Month]),  
    IF(
        NOT(ISBLANK([Total Hours Worked])),  
        DISTINCTCOUNTNOBLANK(Logics[BBS]),
        0
    )
)

It works by month but the total is still wrong. I need the total to only show 32.

HALEYSTODDARD_0-1740967864081.png

 

1 ACCEPTED SOLUTION
v-dineshya
Community Support
Community Support

Hi @HALEYSTODDARD ,

You need to change your DAX so that the total row is calculated correctly. This usually involves detecting if the context is at the total level and then using a different calculation.

My Measure =
IF(
HASONEVALUE(Dates[Month]),
IF(
NOT(ISBLANK([Total Hours Worked])),
DISTINCTCOUNTNOBLANK(Logics[BBS]),
0
),
DISTINCTCOUNTNOBLANK(Logics[BBS])
)

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

View solution in original post

7 REPLIES 7
v-dineshya
Community Support
Community Support

Hi @HALEYSTODDARD ,

You need to change your DAX so that the total row is calculated correctly. This usually involves detecting if the context is at the total level and then using a different calculation.

My Measure =
IF(
HASONEVALUE(Dates[Month]),
IF(
NOT(ISBLANK([Total Hours Worked])),
DISTINCTCOUNTNOBLANK(Logics[BBS]),
0
),
DISTINCTCOUNTNOBLANK(Logics[BBS])
)

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @HALEYSTODDARD ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and consider giving a KUDOS. Feel free to reach out if you need further assistance.

 

Regards,

Dinesh

Hi @HALEYSTODDARD ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and consider giving a KUDOS. Feel free to reach out if you need further assistance.

 

Regards,

Dinesh

Hi @HALEYSTODDARD ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and consider giving a KUDOS. Feel free to reach out if you need further assistance.

 

Regards,

Dinesh

divyed
Super User
Super User

Hello @HALEYSTODDARD ,

 

You need to modify your dax a bit to solve this issue :

 

My Measure =
SUMX(
VALUES(Dates[Month]),
VAR _HoursWorked = [Total Hours Worked]
RETURN
IF(
NOT(ISBLANK(_HoursWorked)),
DISTINCTCOUNTNOBLANK(Logics[BBS]),
0
)
)

 

 

 

Alternatively you can try forcing explicit aggregation if above is not working :

 

My Measure =
SUMX(
SUMMARIZE(
Dates,
Dates[Month],
"@DistinctCount", DISTINCTCOUNTNOBLANK(Logics[BBS])
),
[@DistinctCount]
)

 

I hope this helps.

 

Did I answer your query ? Mark this as solution if this helps, Kudos are appreciated.

 

 

Warm Regards,

Neeraj

 

 

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
Anonymous
Not applicable

Hi @HALEYSTODDARD ,

You can create a new measure as below based on the existing [BBS Rate], then put this new measure onto the visual to replace the measure [BS Rate]:

BBS Rate =
IF (
    NOT ( ISBLANK ( [Total Hours Worked] ) ),
    DISTINCTCOUNTNOBLANK ( Logics[BBS] ),
    0
)

New measure = SUMX ( VALUES ( Dates[Month] ), [BBS Rate] )

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

Best Regards

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please try something like below whether it works.

 

My Measure =
SUMX (
    VALUES ( Dates[Month] ),
    CALCULATE (
        IF (
            NOT ( ISBLANK ( [Total Hours Worked] ) ),
            DISTINCTCOUNTNOBLANK ( Logics[BBS] ),
            0
        )
    )
)


Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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