Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Team,
Good day,
I am trying to calculate the percentage value for the categories against the total value.
DAX formula is working fine but when slicer or filter values are filtered the outpwut is not chnaging and showing as it is.
I am using below DAX function
Kindly help me on this on DAX function for any kind of slicer and filter
thanks
M. Vijay Antony
Solved! Go to Solution.
@Hi @VijayAntonyM
The issue you're experiencing is due to the use of the ALL()
function in your denominator. The ALL()
function removes all filters from your data model, including those applied by slicers and filters in your report. This means the denominator remains constant, and your percentage doesn't change when you apply filters.
To make your percentage calculation responsive to slicers and filters, you should use ALLSELECTED()
instead. The ALLSELECTED()
function keeps the filters applied by slicers and other visuals but removes filters from the current context (like row-level filters in a table or matrix).
Here's the updated DAX formula:
Percentage =
DIVIDE(
SUM(RPT_CARBON_UNPIVOT[Value]),
CALCULATE(
SUM(RPT_CARBON_UNPIVOT[Value]),
ALLSELECTED(RPT_CARBON_UNPIVOT)
)
)
Alternate Approach:
If you want to remove filters only from specific columns (e.g., category column) and keep others, you can use ALL()
with specific columns:
Percentage =
DIVIDE(
SUM(RPT_CARBON_UNPIVOT[Value]),
CALCULATE(
SUM(RPT_CARBON_UNPIVOT[Value]),
ALL(RPT_CARBON_UNPIVOT[CategoryColumn])
)
)
Replace CategoryColumn
with the actual name of your category column.
Summary:
ALL()
with ALLSELECTED()
to respect slicers and filters.If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
@Hi @VijayAntonyM
The issue you're experiencing is due to the use of the ALL()
function in your denominator. The ALL()
function removes all filters from your data model, including those applied by slicers and filters in your report. This means the denominator remains constant, and your percentage doesn't change when you apply filters.
To make your percentage calculation responsive to slicers and filters, you should use ALLSELECTED()
instead. The ALLSELECTED()
function keeps the filters applied by slicers and other visuals but removes filters from the current context (like row-level filters in a table or matrix).
Here's the updated DAX formula:
Percentage =
DIVIDE(
SUM(RPT_CARBON_UNPIVOT[Value]),
CALCULATE(
SUM(RPT_CARBON_UNPIVOT[Value]),
ALLSELECTED(RPT_CARBON_UNPIVOT)
)
)
Alternate Approach:
If you want to remove filters only from specific columns (e.g., category column) and keep others, you can use ALL()
with specific columns:
Percentage =
DIVIDE(
SUM(RPT_CARBON_UNPIVOT[Value]),
CALCULATE(
SUM(RPT_CARBON_UNPIVOT[Value]),
ALL(RPT_CARBON_UNPIVOT[CategoryColumn])
)
)
Replace CategoryColumn
with the actual name of your category column.
Summary:
ALL()
with ALLSELECTED()
to respect slicers and filters.If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
that highly depends on the desired outcome. However, changing ALL ( ) to ALLSELECTED ( ) would most probably solve your problem
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |