cancel
Showing results 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

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

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)

Thanks,

Mohanraj

1 ACCEPTED SOLUTION
Super User

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

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

3 REPLIES 3
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.

Super User

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

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

Anonymous
Not applicable

Thanks a lot, This works

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors