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

Total doesnt add up the line values - even when using HASONEVALUE

Hi everyone, 

 

thanks for this great community! Helped me a lot so far! Before posting this I was reading a loooot of other posts and tried to implement it in the recommended ways but after long time of work and tries i am considering to ask you all here...

I really hope anyone of you can help me with this.

 

As said in the title my column [To Be Fulfilled Service Jobs (h) uEoY 3] doesnt add up as a sum in the totals. I only want the totals to sum up the row value.

 

helpscreen1.JPG

 

 

 

As you can see on the right side, I already have tried a few different things for this column.. without success. Here is one of the 3 tries:

 

To Be Fulfilled Service Jobs (h) uEoY 3 = 

VAR lineValue   =  [Open Service Jobs (h) uEoY]
                * DIVIDE([To Be Fulfilled Service Jobs (#) uEoY];[Open Service Jobs (#) uEoY])

VAR tempTbl = 
    SUMMARIZE(Tabelle1;Tabelle1[EmployeeID]; 'Calendar'[MonthYear]; "ABCD"; lineValue)
    
RETURN
IF (HASONEVALUE('Calendar'[MonthYear]);
    lineValue;
    SUMX(tempTbl;[ABCD])
) 

 

 

Example: 

Month/EmployeeIDTo Be Fulfilled Service Jobs (h) uEoY 3How I would like it
Sep-19 Total124.7205528124.78834...
175.1133499999999875.11334999999998
249.67504037037037549.675040370370375

 

Here is my file:

https://www.dropbox.com/s/q0yflxt6l311zyk/total_not_summing_up_correctly.pbix?dl=0 

 

Pls ask if you need more infos. I hope I included enough information.

 

By the way already read some article like these  (but didnt understand how to use in my case):

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

(thanks @Greg_Deckler )

 

 

 

 

1 ACCEPTED SOLUTION

Hi @robertomari2020 ,

Please try to update the format of measure "To Be Fulfilled Service Jobs (h) uEoY 3" as below:

To Be Fulfilled Service Jobs (h) uEoY 3 =
SUMX (
    VALUES ( 'Calendar'[MonthYear] ),
    SUMX (
        VALUES ( 'Tabelle1'[EmployeeID] ),
        [Open Service Jobs (h) uEoY]
            * DIVIDE ( [To Be Fulfilled Service Jobs (#) uEoY], [Open Service Jobs (#) uEoY] )
    )
)

total incorrect.JPG

Best Regards

Rena

Community Support Team _ Rena
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

10 REPLIES 10
Greg_Deckler
Super User
Super User

It looks to me that you should not be using EmployeeID in your SUMMARIZE. If I understand what you are going for, you should just need MonthYear.


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

Hi Greg,

 

thanks for you really(!) fast answer 🙂

I tried it out like you said, but unfortunately still getting the wrong total... 😞

 

This is what i tried, but still get the old result:

To Be Fulfilled Service Jobs (h) uEoY 3 = 

VAR lineValue   =  [Open Service Jobs (h) uEoY]
                * DIVIDE([To Be Fulfilled Service Jobs (#) uEoY];[Open Service Jobs (#) uEoY])

VAR tempTbl = 
    SUMMARIZE(Tabelle1; 'Calendar'[MonthYear]; "ABCD"; lineValue)
    
RETURN
IF (HASONEVALUE('Calendar'[MonthYear]);
    lineValue;
    SUMX(tempTbl;[ABCD])
) 

Very difficult to troubleshoot these kinds of things. Any way you can share the PBIX? 

 

Hmm, in taking a closer look at your image, try swapping the order of your EmployeeID and MonthYear in your SUMMARIZE so that it matches your hierarchy in your Rows area of the visual. So summarize by MonthYear and then EmployeeID?

 

 


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

Hi Greg, tried to swap the summarize column order, but also didnt work... 😞

 

Can you get the file from here? https://www.dropbox.com/s/q0yflxt6l311zyk/total_not_summing_up_correctly.pbix?dl=0 

 

Thank you for your help and time already!

So, if you replace your SUMX with this:

CONCATENATEX(tempTbl,FORMAT([ABCD],"#.##"),",")

You can see that the first three months match the numbers identically and then things start to diverge. I do not know why. I suspect that somewhere within the nest of measures a filter or something else that is critical to the calculation is going awry or being overridden. It is really difficult to say as the measure nesting is formidable.

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

hmm that could be helpful to trace the error.... but when I replace sumx i get the same value over and over

 

helpscreen2.JPG

 

This problem is killing me... have been trying for days now 😞

Hi @robertomari2020 ,

Please try to update the format of measure "To Be Fulfilled Service Jobs (h) uEoY 3" as below:

To Be Fulfilled Service Jobs (h) uEoY 3 =
SUMX (
    VALUES ( 'Calendar'[MonthYear] ),
    SUMX (
        VALUES ( 'Tabelle1'[EmployeeID] ),
        [Open Service Jobs (h) uEoY]
            * DIVIDE ( [To Be Fulfilled Service Jobs (#) uEoY], [Open Service Jobs (#) uEoY] )
    )
)

total incorrect.JPG

Best Regards

Rena

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

Nice one @v-yiruan-msft !

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

You are kidding me!

Thanks a lot @v-yiruan-msft !! It really works as expected!!!! You saved my week.

 

 

And thanks also @Greg_Deckler for helping me here!

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.

Top Solution Authors