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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX to divide table totals from 2 columns

Hi,

 

In the below table (direct hours (A), and Earned (B)) are delivering the right SUM total.

However, the (performance (C)) column needs to be 153.88 divided by 142.7 .

Basically, I need a table that Sums column A, Sums column B, but column C has to divide the totals of B & A (B:A).

 

Moreover, the table is being filtered by users, using filters for (Assoc_ID, and WK_end_date).

 

I tried this, but it doesn't work:

CALCULATE(DIVIDE(SUM(tblTempReport[earned]),(SUM(tblTempReport[direct_hours])))

 

Alexrk_0-1604679707286.png

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this.

Measure = 
VAR x = 
MAX([Earned])/ MAX([Direct hours])
RETURN
IF(
    HASONEFILTER(Sheet1[Direct hours]),
    x,
    DIVIDE( SUM(Sheet1[Earned]), SUM(Sheet1[Direct hours]) )
)

v-lionel-msft_0-1604888725862.png

 

Best regards,
Lionel Chen

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this.

Measure = 
VAR x = 
MAX([Earned])/ MAX([Direct hours])
RETURN
IF(
    HASONEFILTER(Sheet1[Direct hours]),
    x,
    DIVIDE( SUM(Sheet1[Earned]), SUM(Sheet1[Direct hours]) )
)

v-lionel-msft_0-1604888725862.png

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

@Anonymous , This formula seems fine. What is the issue you are getting

CALCULATE(DIVIDE(SUM(tblTempReport[earned]),(SUM(tblTempReport[direct_hours])))

 

Can you share sample data and sample output in table format?

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks,

 

Yes, it seems that the above formula is OK, but the above result for C should be 107.83, not 14.78.

Here is a more clear example:

Alexrk_1-1604684694542.png

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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