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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tom_McFadyen
Frequent Visitor

Dynamic Difference Column

Hi All,

I am very new to Power BI and I want to make a simple dynamic column that is the difference between my two sources ( 26 - 11).

Any help would be greatly appreciated. 

powerBIHelp.PNG

1 ACCEPTED SOLUTION

Hi @Tom_McFadyen ,

 

Create a measure like so:

 

Diff =
VAR Source26 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 26 )
VAR Source11 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 11 )
RETURN
    Source26 - Source11

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
HashamNiaz
Solution Sage
Solution Sage

Hi @Tom_McFadyen !

 

You can use following DAX to create a new column;

 

New Column = Table[26] - Table[11]

 

Regards,

Hasham

 

Hi Hasham,

 

Unfortunately these aren't individual columns. They are ID's assigned to a normalised row [SecId, SourceID, Value] And I want to calculate the difference between values where secId's are common and calc is SourceID 26 - source ID 11

 

Hi @Tom_McFadyen ,

 

Create a measure like so:

 

Diff =
VAR Source26 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 26 )
VAR Source11 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 11 )
RETURN
    Source26 - Source11

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.