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 am trying to get all measures shown based on selection, I had trouble to show what I needed as the slicer or filter exclude all other records that I need.
What I want to do:
If a select shop B, I want to show, profit of the selected shop, compare to average in its region and compare to average in its state.
Desired result:
Shop B: $150
average of region 1 in CA = (100+150+230)/3 = $160
average of CA $205
Any help is much appreciated.
Solved! Go to Solution.
Hi @Anonymous ,
We can use two measures to meet your requirement. One calculates the average of region, another calculates the average of state.
average of region =
CALCULATE (
AVERAGE ( 'Table'[Profit] ),
ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
'Table'[Region] IN DISTINCT ( 'Table'[Region] ),
'Table'[State] IN DISTINCT ( 'Table'[State] )
)
average of State =
CALCULATE (
AVERAGE ( 'Table'[Profit] ),
ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
'Table'[State] IN DISTINCT ( 'Table'[State] )
)
The result like this,
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can use two measures to meet your requirement. One calculates the average of region, another calculates the average of state.
average of region =
CALCULATE (
AVERAGE ( 'Table'[Profit] ),
ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
'Table'[Region] IN DISTINCT ( 'Table'[Region] ),
'Table'[State] IN DISTINCT ( 'Table'[State] )
)
average of State =
CALCULATE (
AVERAGE ( 'Table'[Profit] ),
ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
'Table'[State] IN DISTINCT ( 'Table'[State] )
)
The result like this,
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try a new measure like
avergageX(summarize(Table,Table[Shop],"_1",sum(Table[profit])),[_1])
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |