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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Divide function with rows and filter total value

Hi,

 

Kindly help me Here! I want below condition to enable in DAX

 

I want Divide function where Numerator needs to be a visible value of each Rows and Denominator needs to be sum  of all Rows with aplly of any filter

 

Example - I have Data like below, and % field need to be below cell Value (D2/D9) - i.e., Row level value divided by Total Value.

Answer will be 21% for E2 

mohanrajg_1-1628720939244.png

But, the problem is, if i apply filter it will not take filtered Total Value for Denominator, Denominator Total Value will be Dynamic (it will change if apply filter ) 

Example:

Ill filter the above Table to Year 2021 only,

Result needed is like below,

Answer will be 35% for the same E2

Denominator - (Total Value) will change dynamically with respect to filter apply and we need to consider the filter context Total value as a Denominator) 

mohanrajg_2-1628721371649.png

 

Please help here.

 

Thanks,

Mohanraj

 

@amitchandak @Fowmy @Jihwan_Kim @Greg_Deckler 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try if, a measure like this can help 

 

divide(sum(Table[Value]), calculate(sum(Table[Value]), allselected(Table)))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
Mohammad_Refaei
Solution Specialist
Solution Specialist

Create a measure like this:

MyMeasure =
DIVIDE (
    SUM ( Table[Value] ),
    CALCULATE (
        SUM ( Table[Value] ),
        ALLEXCEPT ( Table, Table[Year], Table[Month] )
    )
)

Replace Table with your table name.

amitchandak
Super User
Super User

@Anonymous , Try if, a measure like this can help 

 

divide(sum(Table[Value]), calculate(sum(Table[Value]), allselected(Table)))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thanks a lot, This works

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.