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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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