Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
rakeshmistry1
New Member

MAKE SUMMARY / DEDUCTION OF MEASURE VALUE FROM COLUMN VALUE IN POWER BI DAX IN DIRECT QUERY MODE

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?

3 REPLIES 3
123abc
Community Champion
Community Champion

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:

Using a Calculated Column:

  1. Create a new calculated column: Go to your table in the Data view.
  2. Right-click on the table name and select New Column.
  3. Use the DAX formula to subtract the measure value from the DocTotal column. Let's say your measure is named MeasureValue, then the formula would be:

DAX:

NewColumn = [DocTotal] - MeasureValue

 

Using a Measure:

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.

  1. Go to the Modeling tab in the Power BI Desktop.
  2. Click on New Measure.
  3. Enter the following DAX formula:

 

DAX:

Difference = SUM('YourTableName'[DocTotal]) - MeasureValue

 

  1. Here, replace 'YourTableName' with the name of your table and MeasureValue with the name of your existing measure.

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.

Dangar332
Super User
Super User

hi, @rakeshmistry1 

try below for measure

 

measure1 =
  MIN('Table'[doctotal)-[Measure]

 

 

try below  for column 

column =
 'Table'[doctotal]-[Measure]

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.