Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi All,
Looking for suggestions to evaluate an expression e.g. Sum(A minus B) for Country, where the value will be the same across quarters:
Quarter | Country | A | B |
Q1 | Japan | 1872 | 1835 |
Q2 | India | 335 | 726 |
Q2 | Japan | 586 | 871 |
Q1 | USA | 1235 | 1903 |
Q3 | India | 710 | 1935 |
Q1 | Germany | 1274 | 1327 |
Q2 | USA | 1647 | 531 |
For the above example, the value should be:
Q1 | Japan | -248 |
Q2 | India | -1616 |
Q2 | Japan | -248 |
Q1 | USA | 448 |
Q3 | India | -1616 |
Q1 | Germany | -53 |
Q2 | USA | 448 |
For Japan, Sum(A) = 2,458 and Sum(B) = 2,706.. and thus Sum(A-B) = -248
(The value will be same if each row is evaluated for A-B and then the final Sum is calculated)
Thanks in advance! 🙂
Solved! Go to Solution.
Hi @Anonymous ,
Please try this:
Measure = CALCULATE(SUM('Table'[A]) - SUM('Table'[B]),ALLEXCEPT('Table','Table'[Country]))
Aiolos Zhao
Hi @Anonymous ,
You can use below measure directly:
Measure = SUM('Table'[ A]) - SUM('Table'[ B])
Aiolos Zhao
Hi AiolosZhao,
Edited the question.. Need to get the same value for country irrespective of other columns.
Have taken Quarter as an example, could be more than that
Hi @Anonymous ,
Please try this:
Measure = CALCULATE(SUM('Table'[A]) - SUM('Table'[B]),ALLEXCEPT('Table','Table'[Country]))
Aiolos Zhao
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |