Forum Discussion
Data Aggregation Issue
- 1 year ago
This issue occurs because your DAX measure might not be correctly handling the slicer selections and is summing up instead of averaging based on the unique donor count. Try doing somehing like this.
Frequency = VAR UniqueDonors = DISTINCTCOUNT( Donations[DonorID] ) RETURN DIVIDE( SUM( Donations[Amount] ), UniqueDonors, 0 )If your frequency metric is in a table that is affected by slicers, wrap the calculation in CALCULATE to ensure it respects slicer selections.
Frequency = VAR UniqueDonors = CALCULATE( DISTINCTCOUNT( Donations[DonorID] ), ALLSELECTED(Donations[Ethnicity]) ) RETURN DIVIDE( SUM( Donations[Amount] ), UniqueDonors, 0 )This will ensure that when multiple are selected, the correct unique donor count is used rather than incorrectly summing across selections.
Let me know if this helps!
Hi,Power2G ,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hello,Abz_17 .I am glad to help you.
Has your problem been solved?
For your measure, I think it may be due to the complexity of the filtering environment that the end result of the measure is incorrect. You can try to use ALLEXCEPT or ALLSELECTED function in your measure to limit the filter fields.
The ALLEXCEPT function removes other filters while preserving the filtering context of a particular column, ensuring that the frequency measure is calculated correctly even if multiple slicers are selected.
Alternatively, use the CALCULATE and FILTER functions to artificially specify the computational context in the measure (suggested by Power2G)
How to Get Your Question Answered Quickly - Microsoft Fabric Community
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.