March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I have below base table:
Date | Column 2 | Column 3 | Column 4 | Column 5 |
2023-12 | C | MF12 | 0 | 0 |
2023-11 | C | MF12 | 0 | 0 |
2023-12 | E | MF12 | 0 | 0 |
2023-11 | E | MF12 | 0 | 4835 |
2023-10 | E | MF12 | 0 | 4835 |
2023-10 | C | MF12 | 7615 | 15454 |
2023-12 | D | MF12 | 5687 | 5888 |
2023-11 | D | MF12 | 7615 | 15454 |
2023-10 | D | MF12 | 5687 | 5888 |
2023-11 | D | AF12 | 0 | 6 |
2023-10 | D | AF12 | 100 | 35 |
2023-12 | D | AF12 | 100 | 6 |
2023-10 | C | AF12 | 52133 | 35117 |
2023-12 | C | AF12 | 75252 | 65659 |
2023-11 | C | AF12 | 66480 | 62601 |
2023-11 | E | AF12 | 75152 | 65624 |
2023-12 | E | AF12 | 66480 | 62595 |
2023-10 | E | AF12 | 52033 | 35111 |
Aggregated table at backend would look something like this (which is not required in output, mentioned just for reference)
Column 2 | Column 3 | Column 4 | Column 5 | Cal Col1 | Cal Col2 |
C | MF12 | 7615 | 15454 | 102.94 | 783900 |
C | AF12 | 193865 | 163377 | 15.73 | 3048800 |
D | MF12 | 18989 | 27230 | 43.4 | 824100 |
D | AF12 | 200 | 47 | 76.5 | 15300 |
E | MF12 | 0 | 9670 | 0 | 0 |
E | AF12 | 193665 | 163330 | 15.66 | 3033500 |
Total | 7705600 |
Required output is to get the Total(7705600) for CalCol2 as measure.
Formula for:
Cal Col1=Abs(Column 5 - Column 4)*100/Column 4
Cal Col2=Cal Col1 * Column 4
PS: If not by aggregation method, any other method which can help achieve the desired result of Total for CalCol2 as 7705600 would be helpful
Solved! Go to Solution.
Measure =
var a = summarize('Table',[Column 2],[Column 3])
var b = addcolumns(a,"Cal Col1",DIVIDE(abs(CALCULATE(sum('Table'[Column 5]))-CALCULATE(sum('Table'[Column 4])))*100,CALCULATE(sum('Table'[Column 4])),0))
var c = ADDCOLUMNS(b,"Cal Col2",[Cal Col1]*CALCULATE(sum('Table'[Column 4])))
return sumx(c,[Cal Col2])
Measure =
var a = summarize('Table',[Column 2],[Column 3])
var b = addcolumns(a,"Cal Col1",DIVIDE(abs(CALCULATE(sum('Table'[Column 5]))-CALCULATE(sum('Table'[Column 4])))*100,CALCULATE(sum('Table'[Column 4])),0))
var c = ADDCOLUMNS(b,"Cal Col2",[Cal Col1]*CALCULATE(sum('Table'[Column 4])))
return sumx(c,[Cal Col2])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |