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,
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
168 | |
116 | |
63 | |
57 | |
50 |