Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello!
I got the following challenge which I haven't been able to overcome:
Territory Fact Manufacturer Brand Product Date Value
North Value A X Item1 12/31/2018 $10
South Qty A X Item2 11/30/2018 5
North Qty B Y Item3 01/31/2019 2
West Value C Z Item4 02/28/2018 $11
In order to separate Value from Qty, I created 02 measures:
Value$ = CALCULATE(SUM(MarketShare[Value]);MarketShare[Fact] = "Value") Volume = CALCULATE(SUM(MarketShare[Value]);MarketShare[Fact] = "Qty")
Simply using:
AvgPrice = (CALCULATE([Value$]/ [Volume]))
...gives me the average price, but when it's displayed on matrix table, with brand as rows and territory as columns.
If I want to use it on a bar chart and selected Territory in the Slicer, then I start getting infinity related errors.
Thanks in advance!
Solved! Go to Solution.
Hi @Asantos2020 ,
I modified your measure as belows:
Value$ = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact] = "Value"),VALUES(MarketShare[Territory]))
Volume = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact]="Qty"),VALUES(MarketShare[Territory]))
AvgPrice = DIVIDE([Value$],[Volume])Result shown as below: (AvgPrice will change based on territory)
Hi @Asantos2020 ,
I modified your measure as belows:
Value$ = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact] = "Value"),VALUES(MarketShare[Territory]))
Volume = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact]="Qty"),VALUES(MarketShare[Territory]))
AvgPrice = DIVIDE([Value$],[Volume])Result shown as below: (AvgPrice will change based on territory)
What if you used the Divide function instead of "/" ?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
107 | |
99 | |
39 | |
30 |