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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
maximpolderman
New Member

total of expression on each row

Hello,

 

I would like to divide my table data with one specific row. So every table has a percentage according to row number 3. I already figured out how to show only totals for row 3 with an expression, however I can not divide every row by it, because all rows apart from row nr 3 are empty in the column ProcentVanTotaleOmzet. So I would like to know how to show the total on each row, or maybe store a variable somewhere and divide each row with that variable (being the total of row number 3).

 

powerbi.png

 

The formula used for 'ProcentVanTotaleOmzet' : 

ProcentVanTotaleOmzet = calculate(sum(FullTable[_Amount]);FullTable[PLSort]=3)

PLSort is equal to the rownumber in this case

 

Kind Regards

Maxim

1 ACCEPTED SOLUTION

Hi there,

 

Happy to help. So DAX calculates row by row, since this value is only on row 3, without the right context in your filter the other rows will be blank. This can be solved by including the ALL statement in your filter context shown below. 

 

=
CALCULATE (
    SUM ( FullTable[_Amount] ),
    FILTER ( ALL ( FullTable ), FullTable[PLSort] = 3 )
)

This should now return -1,370,433 value for every row, allowing the division you'd need. Let me know if this works!

 

Reid Havens

Havens Consulting Inc.

View solution in original post

2 REPLIES 2

Hi there,

 

Happy to help. So DAX calculates row by row, since this value is only on row 3, without the right context in your filter the other rows will be blank. This can be solved by including the ALL statement in your filter context shown below. 

 

=
CALCULATE (
    SUM ( FullTable[_Amount] ),
    FILTER ( ALL ( FullTable ), FullTable[PLSort] = 3 )
)

This should now return -1,370,433 value for every row, allowing the division you'd need. Let me know if this works!

 

Reid Havens

Havens Consulting Inc.

Hi Reid Havens

 

The solution works perfectly. 

Thank you very much!

 

Maxim Polderman

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors