The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello
I want to create a measure - I know I am close, but it still doesn't do exactly what I need. Below all the details:
As you can see here, the goal is the get this 1.15% by dividing the metric 2 by the metric 1.
Except, we want to calculate the metric 2 only when a store has over 50.
And, we want to calculate the metric 1 only when a store has over 0 (simply to say that we need to sum, per store, only when 2 is present).
The measure provide below works well when only one store is filtered. However, when several are, like the example below, it takes too many values from 'metric 1' (metric 2 doesn't seem to be the issue here).
I should be able to look a this measure in a card without filters. And in a table when adding stores to see per store.
Could you please help me, or guide me to the right answer?
*(this is an example, the real tables have way more rows and dimensions. There are also over 100 stores.)
Measure =
Var Dtable =
FILTER(
'Table D',
[Metric 2 ]>50)
Var Ctable =
FILTER(
TableC,
[Metric 2 ]>0)
Var _B =
CALCULATE([Metric 2],Btable)
Var _A =
CALCULATE([Metric 1],dtable,ctable,ALLEXCEPT(TableA,TableC[Date]))
Return
DIVIDE(_B,_A)
Thank you,
BT
Read about aggregation function like SUMMARIZE.
Think like the Grand Total. Very often measures designed for the Grand Total will also work for the Row and Column Totals and for the individual cells.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
64 | |
46 | |
38 |