Forum Discussion
powerbi matrix visuals shows wrong numbers
anglefbi11 Pie Chart (Highlight Option):
When using the highlight option, the pie chart shows a portion of the data while still displaying the overall context. This means that the percentage calculation can be more accurate because it retains the full data set context, showing how much of the whole is highlighted.
When you use the filter option, the pie chart only displays the filtered subset of the data. If the percentage appears wrong, it might be because the filter changes the context of the data, leading to a different calculation for the measure. This can result in the measure being evaluated only on the filtered data set, which may not match your expectations.
Solution
Here’s an example of how you might write a DAX measure to correctly handle context:
Ensure that your measure is context-aware and correctly handles the different contexts it is evaluated in. You might need to use DAX functions such as CALCULATE, ALL, or FILTER to control how the context affects your measure.
CorrectedPercentage =
VAR TotalValue = CALCULATE(SUM(Table[Value]), ALL(Table))
RETURN DIVIDE(SUM(Table[Value]), TotalValue, 0)
This measure calculates the percentage of the total value regardless of filters applied, ensuring consistency across different visuals.
Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
hala fahad
the issue as you said shows when i apply filters ( you are right )
but i need small help
these are my current measures how do i apply what you wrote above?
i have two measuers ( one to show me the count and the second is for percentage )
count = COUNTROWS('Query1')
percentage = DIVIDE([count], CALCULATE( [count],ALL(Query1[Minutes (bins)])))