Glyn
Glyn

Reputation: 1995

Power BI Desktop how to subtract a value from a row using new measure

I am using Power BI Desktop an want to calculate a new measure subtracting 126 from a row value. I start with:

enter image description here

I then add:

Reassign = calculate (sum('sdowner SPV_REP_PERSONALTAB'[Total]) - 126)

This results in: enter image description here

How do I perform this calculation without adding all these extra rows please?

Upvotes: 0

Views: 551

Answers (1)

sergiom
sergiom

Reputation: 4877

It might suffice to test for the value not being blank using IF and a variable to avoid duplicate calculations, like for instance

Reassign =
VAR ValSum =
    CALCULATE( SUM( 'sdowner SPV_REP_PERSONALTAB'[Total] ) )
RETURN
    IF( NOT ISBLANK( ValSum ), ValSum - 126 )

Upvotes: 1

Related Questions