The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have one Table which hace one Column DocTotal and One Measure bringing value from other table. And I want to substract Measure value from Column DocTotal.
How to do it?
Certainly! To subtract a measure value from a column value in Power BI using DAX, you can create a new calculated column or use a measure to perform the subtraction.
Here's how you can do it:
DAX:
NewColumn = [DocTotal] - MeasureValue
If you prefer to use a measure (which is more dynamic than a calculated column), you can create a new measure to calculate the difference between the DocTotal column and the measure value.
DAX:
Difference = SUM('YourTableName'[DocTotal]) - MeasureValue
Remember, the approach you choose (calculated column vs. measure) depends on your specific requirements. Calculated columns add data to your table, while measures are calculated on the fly based on the context of your report. If you want the subtraction to be dynamic and change based on filters or slicers, then using a measure is more appropriate.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi Thanks for your reply. @123abc & also @Dangar332 . What is happening is as below..
When I try new column with total doc - measure it says that its can't work in direct query mode.
And when I try measure - it gives error that - MIN function only accepts column ref as an argument
So both solutions I tried but its not working.
hi, @rakeshmistry1
try below for measure
measure1 =
MIN('Table'[doctotal)-[Measure]
try below for column
column =
'Table'[doctotal]-[Measure]
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |