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 there,
As in the first picture you can see that I have 3 columns. What I want to achieve here is the exact solution as picture second. Now I will explain.
As you can see there is a column named as "Quarter", which contains 2 values-Q1 and Q2. I want to total the sales column values according to the Quarter Category. Same as it is happening in the 2nd Picture. I want to do this, to calculate the margin afterwords.
BUT HERE IS A TWIST:
I know how to do this, in M code and Power Query. But I want the solution, If we want to create this kind of column as a new measure. I can't figure out the solution for this case.
Thanks and regards.
Solved! Go to Solution.
@Birinder I think you want:
Sub-Total Each Category Measure =
VAR __Quarter = MAX('Table'[Quarter])
RETURN
SUMX(FILTER(ALL('Table'),[Quarter]=__Quarter),[Sales])
Margin Measure =
[Sub-Total Each Category Measure] - MAX('Table'[Sales])
Hi there,
Thanks for the reply.
I want to ask you, Will this work if All the three columns ; "Quarter", "Model" and "Sales" are from 3 seperate tables, and are connected via relationship.
If Yes, then Inplace of "table" in code given by you, What am I supposed to enter.
Thanks and Regards
@Birinder I think you want:
Sub-Total Each Category Measure =
VAR __Quarter = MAX('Table'[Quarter])
RETURN
SUMX(FILTER(ALL('Table'),[Quarter]=__Quarter),[Sales])
Margin Measure =
[Sub-Total Each Category Measure] - MAX('Table'[Sales])
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 |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |