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
Applicable88
Impactful Individual
Impactful Individual

Divide through Total not row ccontex wise

Hello,

for example I want the total amount divided through the needed to get the Column "Ratio", how to I get the total values

 

ObjectPos.NoAmountNeededRatioRatioWrong
BAB160031000,160,04
BAB1610131000,160,19
BAB280052000,060,0125
BAB281072000,060,035

sum('Table1'[Amount]) / sum('Table2'[Needed]) always is in row context. The total amount of the object BAB1 for example is 16. I want to get out of the row context, to get the Total Ratio of that Object divided through one time of "Needed". Thats the reason why I get "RatioWrong" instead.

For Object BAB2 it should be 5+7 divided throgh 200, which equals 0,06. I tried a caluclate with the "All-Filter", but that doesn't differentiate between the different Objects. 

 

Thank you very much in advance.

Best. 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Applicable88,

 

Try measure as:

Measure = 
CALCULATE(
    DIVIDE(
        SUMX(FILTER(ALL('Table'),'Table'[Object]=MAX('Table'[Object])),'Table'[Amount]),
        CALCULATE(MAX('Table'[Needed]))))

Here is the output:

vxulinmstf_0-1628148577594.png

The demo is attached, please try it.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

View solution in original post

4 REPLIES 4
v-xulin-mstf
Community Support
Community Support

Hi @Applicable88,

 

Try measure as:

Measure = 
CALCULATE(
    DIVIDE(
        SUMX(FILTER(ALL('Table'),'Table'[Object]=MAX('Table'[Object])),'Table'[Amount]),
        CALCULATE(MAX('Table'[Needed]))))

Here is the output:

vxulinmstf_0-1628148577594.png

The demo is attached, please try it.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

ryan_mayu
Super User
Super User

@Applicable88 

maybe try

calculate(sum('Table1'[Amount]),allexcept(sum('Table1','Table1'[Object]))/ sum('Table2'[Needed])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello @ryan_mayu , that isn't working. The syntax is not right. But I deleted the first argument of allexcept. Because I guess the double "sum" is one too much there. 

But now it sums up all the "needed" amount and that one should only be divided one time. For Object BAB1 it should be 16/100 oder for BAB2 it should be 12/200. Have any idea how to get there? 

@Applicable88 

maybe separate the DAX and test for each part

check if below returns 16 for BAB1 and 12 for BAB2

calculate(sum('Table1'[Amount]),allexcept(sum('Table1','Table1'[Object]))

 

if you can provide the pbix file , that will be easier for us to provide the proper solution.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.