Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
How to create a new measure to calculate the difference between 2 columns?
Eg. 967,063 - 226,556
Thanks.
Solved! Go to Solution.
Hi, @pang22
Sample data:
Measure =
Var _N1=CALCULATE(SUM('Table'[Qty]),FILTER(ALLEXCEPT('Table','Table'[Month]),[Type]="OPN"))
Var _N2=CALCULATE(SUM('Table'[Qty]),FILTER(ALLEXCEPT('Table','Table'[Month]),[Type]="Order OH"))
Return
IF(HASONEVALUE('Table'[Type]),SUM('Table'[Qty]),_N1-_N2)
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @pang22
Sample data:
Measure =
Var _N1=CALCULATE(SUM('Table'[Qty]),FILTER(ALLEXCEPT('Table','Table'[Month]),[Type]="OPN"))
Var _N2=CALCULATE(SUM('Table'[Qty]),FILTER(ALLEXCEPT('Table','Table'[Month]),[Type]="Order OH"))
Return
IF(HASONEVALUE('Table'[Type]),SUM('Table'[Qty]),_N1-_N2)
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
measures need aggregations. So instead of saying
measure = [Column1]-[Column2]
you need to say
measure = sum(Table[Column1])-sum(Table[Column2])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
142 | |
75 | |
64 | |
52 | |
47 |
User | Count |
---|---|
219 | |
89 | |
73 | |
66 | |
60 |