Skip to main content

Power BI

New

Overwrite Variables when calling a measure

Vote (1) Share
Kristinn Thor Sigurjonsson's profile image

Kristinn Thor Sigurjonsson on 26 Oct 2022 08:44:58

In some cases I would like to be able to overwrite a variable in a measure when using it in another measure.

For example:

If I have a measure like this:

Base = 
VAR number = 1
RETURN
number

and want to use that measure in another measure but with a different value for the variable.


I would like if there was a option to write something like "OVERWRITEVAR()" like this:

Override = 
CALCULATE(
    Test,
    OVERRIDEVAR(number = 2)
)

Then I can have one base measure that I can reference with different variable value for related measures.


I can't be the only one....