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
Anonymous
Not applicable

Sum For All in Power bi

Hi, I was having trouble with this calculation. I have tried many ways but I'm not getting the right answer. I'm confused with using measures of column too.....

zhrhr_0-1610620331307.png

such as CALCULATE( DIVIDE(SUM(CA_FACT_MGMT_SUM[NPT_HRS]),SUM(CA_FACT_MGMT_SUM[COMPLETION_HRS]) ))
 
SUM(CA_FACT_MGMT_SUM[NPT_HRS])/SUM(CA_FACT_MGMT_SUM[COMPLETION_HRS])
 
CALCULATE( SUMX( CA_FACT_MGMT_SUM, CA_FACT_MGMT_SUM[NPT_HRS]/CA_FACT_MGMT_SUM[COMPLETION_HRS]))


this is my pbix file https://1drv.ms/u/s!AoKh3nlpMpSOgmP2W6IHiupBOk3U?e=zHodcX

I actually want a straight average line based on that formula. The expected output for year 2020 is 9.7%.
1 ACCEPTED SOLUTION

Hi, @Anonymous 

Try measure as below:

 

NPT_%_new =
CALCULATE (
    SUM ( Sheet1[NPT_HRS] ) / SUM ( Sheet1[COMPLETION_HRS] ),
    ALLEXCEPT ( Sheet1, Sheet1[YEAR] )
)

 

 20.png

Refer to sample file for more details.

Best Regards,
Community Support Team _ Eason
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

3 REPLIES 3
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hi, I would reccomend you to post a example data input and the expect result and explain what you want the measures to do exactly, for a better response.





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

@StefanoGrimaldi hi. This is my pbix file. For that formula, I need a straight average line to include in this chart. For year 2020, the AVG NPT % should be 9.7%. Appreciate if you could help me

https://1drv.ms/u/s!AoKh3nlpMpSOgmP2W6IHiupBOk3U?e=zHodcX

Hi, @Anonymous 

Try measure as below:

 

NPT_%_new =
CALCULATE (
    SUM ( Sheet1[NPT_HRS] ) / SUM ( Sheet1[COMPLETION_HRS] ),
    ALLEXCEPT ( Sheet1, Sheet1[YEAR] )
)

 

 20.png

Refer to sample file for more details.

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

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.