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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

calculating the difference between two lines

 

Kevine_Mbogning_0-1666608679374.png

Hello I have a concern please. I would like to have the result of this table in dax, that is to say income-expenditure knowing that I have created a group where other are the income and other are the expenses.

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Because in the measure, when I use the column, it will return to the value of the column itself to me, as follows, I made the relevant adjustments to the data and got still their difference, in addition to the field total can be adjusted to another name by itself(the max in measure not get the max value ,and it get the base value ,it equare you create a new column that is new column=value):

vluwangmsft_0-1666836194871.png

vluwangmsft_1-1666836203751.png

 

 

Best Regards

Lucien

View solution in original post

5 REPLIES 5
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Because in the measure, when I use the column, it will return to the value of the column itself to me, as follows, I made the relevant adjustments to the data and got still their difference, in addition to the field total can be adjusted to another name by itself(the max in measure not get the max value ,and it get the base value ,it equare you create a new column that is new column=value):

vluwangmsft_0-1666836194871.png

vluwangmsft_1-1666836203751.png

 

 

Best Regards

Lucien

v-luwang-msft
Community Support
Community Support

Hi  @Anonymous ,

Create measure like the below:

TEST = 
IF (
    HASONEVALUE ( 'Table'[Type1] ),
    MAX ( 'Table'[value] ),
    CALCULATE ( MAX ( 'Table'[value] ), FILTER ( 'Table', 'Table'[Type1] = "A" ) )
        - CALCULATE ( MAX ( 'Table'[value] ), FILTER ( 'Table', 'Table'[Type1] = "B" ) )
)

 

vluwangmsft_0-1666688313026.png

 

Best Regards

Lucien

Anonymous
Not applicable

Please what is 'table'[value]

Hi @Anonymous ,

The data in the table used to become the values in the matrix you created, are as follows:

vluwangmsft_0-1666777607453.png

 

 

Best Regards

Lucien

Anonymous
Not applicable

And as it is several columns which are on value how to do it please? In your case it's A1 and A2 how to put them in MAX

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors