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 everyone !
I have a simple table, like this one :
I want to create a measure with different steps :
1 - Sum "Qty" column grouping on "Product" column
2 - Evaluate if the result of "Step 1" is negative. If it's true, return 0 else return "Step 1"
3 - Sum "Step 2"
The result i'm expecting for this dataset is : 27
I can't specify in my measure every products with a switch formula because in my original dataset there is between 700 and 3500 different cases.
An important information is that, in the bar chart which will show the measure evolution through time, there is no "Product" filter context.
Any idea ? 🙂
Solved! Go to Solution.
Hi @Anonymous
This measure may help
M_Product =
VAR __Step1 = SUMMARIZE(TableProduct;TableProduct[Product];"TotalProduct";sum(TableProduct[Qty]))
VAR __Step2and3 = CALCULATE(SUM([Qty]);FILTER(__Step1;[TotalProduct]>0))
RETURN __Step2and3
Let me know if that is fine.
Hi @Anonymous
This measure may help
M_Product =
VAR __Step1 = SUMMARIZE(TableProduct;TableProduct[Product];"TotalProduct";sum(TableProduct[Qty]))
VAR __Step2and3 = CALCULATE(SUM([Qty]);FILTER(__Step1;[TotalProduct]>0))
RETURN __Step2and3
Let me know if that is fine.
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 |
---|---|
39 | |
20 | |
19 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |