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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.