Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi - I have a DAX weighted average formula that works without a slicer.
When I add a slicer for Markets the DAX continues to calculate at the All Markets level versus the market level.
Can you help me adjust my DAX to consider the slicer?
Hi, @Quinnie2017
It‘s not clear that the field on the slicer is on which table. You can try to use allselected() function in the formula involving that table.
Like this:
Weighted Avg Impact =
SUMX (
SUMMARIZE ( ALLSELECTED ( 'Day Key' ), 'Day Key'[KBP PD] ),
DIVIDE (
CALCULATE ( [Avg Impact] * COUNTA ( MASTER[Store] ), ALLSELECTED ( 'MASTER' ) ),
CALCULATE (
COUNT ( 'Cost Center'[Cost_CenterKey] ),
'Cost Center'[CC Type] = "Store",
ALLSELECTED ( 'Cost Center' )
)
)
)
[Avg Impact] seems to be a measure, it may also need to change.
If it doesn't solve your problem, Can you share a sample file and feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
101 | |
78 | |
70 | |
64 |
User | Count |
---|---|
140 | |
106 | |
100 | |
83 | |
73 |