Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, looking for some advice
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?
Solved! Go to Solution.
Hi @Phellipe
For your question, here is the method I provided:
Here's some dummy data
"Table"
First, add the index column in “Transform data”
Click Close & Apply.
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.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Perfect, works like a charm 🙂
Hi @Phellipe
For your question, here is the method I provided:
Here's some dummy data
"Table"
First, add the index column in “Transform data”
Click Close & Apply.
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.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @Phellipe ,
There must be some order(A column that makes sure that records are ordered correctly before performing calculation) to achieve this.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |