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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Phellipe
New Member

Refer to multiple column values

Hi, looking for some advice

Phellipe_0-1707128099600.png

i got this table and i need to add adittional column which will balance negative numbers - currently on line for SQL SRV 2018 Ent Core 2017 there is "-186" and new output should be 0 and row for SQL SRV 2022 Ent Core should be by 186 less (760-186)

- similary for Standard - 2019 would be 0 and 2022 version would be less by 324 (460-324)

basicaly apply downgrading licensing option 

any ideas please? 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Phellipe 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1707296301827.png

 

First, add the index column in “Transform data”

vnuocmsft_1-1707296446993.png

 

vnuocmsft_2-1707296461691.png

 

Click Close & Apply.

vnuocmsft_3-1707296513179.png

 

Create a measure. Add extra columns to balance negative numbers - currently SQL SRV 2018 Ent Core 2017's rows have "-186", the new output should be 0, SQL SRV 2022 Ent Core's rows should be 186 less (760-186).

 

New_Delta = 
    var _delta = IF(
        SELECTEDVALUE('Table'[Delta]) <> SELECTEDVALUE('Table'[Entitlements]), 
        VALUES('Table'[Delta]), 
        CALCULATE(
            ABS(MIN('Table'[Delta])), 
            FILTER(
                ALL('Table'), 
                'Table'[Index] = MAX('Table'[Index]) -1
            )
        )
    )
RETURN 
    IF(
        SELECTEDVALUE('Table'[Delta]) > 0 
        && 
        SELECTEDVALUE('Table'[Delta]) <> SELECTEDVALUE('Table'[Entitlements]), 
        VALUES('Table'[Delta]), 
        SELECTEDVALUE('Table'[Delta]) - _delta
    )

 

Here is the result.

 

vnuocmsft_4-1707296778791.png

 

Regards,

Nono Chen

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
Phellipe
New Member

Perfect, works like a charm 🙂

Anonymous
Not applicable

Hi @Phellipe 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1707296301827.png

 

First, add the index column in “Transform data”

vnuocmsft_1-1707296446993.png

 

vnuocmsft_2-1707296461691.png

 

Click Close & Apply.

vnuocmsft_3-1707296513179.png

 

Create a measure. Add extra columns to balance negative numbers - currently SQL SRV 2018 Ent Core 2017's rows have "-186", the new output should be 0, SQL SRV 2022 Ent Core's rows should be 186 less (760-186).

 

New_Delta = 
    var _delta = IF(
        SELECTEDVALUE('Table'[Delta]) <> SELECTEDVALUE('Table'[Entitlements]), 
        VALUES('Table'[Delta]), 
        CALCULATE(
            ABS(MIN('Table'[Delta])), 
            FILTER(
                ALL('Table'), 
                'Table'[Index] = MAX('Table'[Index]) -1
            )
        )
    )
RETURN 
    IF(
        SELECTEDVALUE('Table'[Delta]) > 0 
        && 
        SELECTEDVALUE('Table'[Delta]) <> SELECTEDVALUE('Table'[Entitlements]), 
        VALUES('Table'[Delta]), 
        SELECTEDVALUE('Table'[Delta]) - _delta
    )

 

Here is the result.

 

vnuocmsft_4-1707296778791.png

 

Regards,

Nono Chen

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

 

talespin
Solution Sage
Solution Sage

hi @Phellipe ,

 

There must be some order(A column that makes sure that records are ordered correctly before performing calculation) to achieve this.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.