Reply
ArvindJha
Helper II
Helper II
Partially syndicated - Outbound

power bi parameter

Hi Team,

 

Below is data

IDSubjectPrevValueCurrValue
11232527
112324

24

 

Below DAX works :

Flag = IF (
   
    Sheet1[PrevValue] < 27 && Sheet1[CurrValue] >= 27,
    "Yes",
    "No"
)
 
but i want to replace 27 with dynamic value using parameter which doesn't work like below :
FlagParameter = IF (
   
    Sheet1[PrevValue] < [Threshold Value] && Sheet1[CurrValue] >= [Threshold Value],
    "Yes",
    "No"
)
11 REPLIES 11
Cookistador
Continued Contributor
Continued Contributor

Syndicated - Outbound

I upload my PBIX in my g drive, it will be easier to understand for you

 

Do not hesisate to ask if something is not clea

https://drive.google.com/file/d/1KY6DAcgzTii7AfwOGJ3PqIeE2Fh2yXL_/view?usp=sharing

ArvindJha
Helper II
Helper II

Syndicated - Outbound

ArvindJha_0-1743671816123.png

 

static values work

Syndicated - Outbound

it is normal, when you create a calculated column, the column will read the static value and then won't change, it is the same with a slicer parameter

It will change only when you refreshed the semantic model

The measure will be refresh each time something changed on the visual

Syndicated - Outbound

Hi @ArvindJha 

Follow these steps

1) create a numeric range with the following parameters

Cookistador_0-1743672174762.png

2) create the following measure
Flag Measure = IF (
SELECTEDVALUE('Sheet1'[PrevValue]) < 27 && SELECTEDVALUE('Sheet1'[CurrValue]) >= Threshold[Threshold Value],
"Yes",
"No"
)

3) Add it in the tableau 

4) play with the sclicer

Result with a smaller value

Cookistador_1-1743672280060.png

Result with a higher value

Cookistador_2-1743672300970.png

 

Syndicated - Outbound

Tried all the above steps still not working 

ArvindJha_0-1743676497905.png

 

Syndicated - Outbound

ArvindJha_1-1743676538116.png

 

Cookistador
Continued Contributor
Continued Contributor

Syndicated - Outbound

Hello @ArvindJha 

It is normal, a calculated column will be refreshed only when you refreshed your dataset
You have to use a measure to achieve that

This dax measure returns what you try to achieve

 

Flag Measure = IF (
SELECTEDVALUE('Table'[PrevValue]) < 27 && SELECTEDVALUE('Table'[CurrValue]) >= Parameter[Parameter Value],
"Yes",
"No"
)

 

For the Parameter, I created a new parameter ==> Numeric range

Syndicated - Outbound

Even when i use as measure it does not work :

FlagParameter = IF (
   
    Sheet1[PrevValue] < Threshold[Threshold Value] && Sheet1[CurrValue] >= Threshold[Threshold Value],
    "Yes",
    "No"
)

Syndicated - Outbound

Hi @ArvindJha 

 

It is normal, use the following dax measure instead

 

Flag Measure = IF (
SELECTEDVALUE('Sheet1'[PrevValue]) < 27 && SELECTEDVALUE('Sheet1'[CurrValue]) >= Threshold[Threshold Value],
"Yes",
"No"
)

 

You have to aggregate your column to use a measure

bhanu_gautam
Super User
Super User

Syndicated - Outbound

@ArvindJha Click on "New Parameter" and create a parameter named Threshold Value.
Set the data type to the appropriate type (e.g., Whole Number) and define the minimum, maximum, and default values.

Once the parameter is created, it will be available in your data model.
You can then reference this parameter in your DAX formula.

 

FlagParameter = IF (
Sheet1[PrevValue] < 'Parameter Table'[Threshold Value] && Sheet1[CurrValue] >= 'Parameter Table'[Threshold Value],
"Yes",
"No"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Syndicated - Outbound

Even when i use as measure it does not work :

FlagParameter = IF (
   
    Sheet1[PrevValue] < Threshold[Threshold Value] && Sheet1[CurrValue] >= Threshold[Threshold Value],
    "Yes",
    "No"
)
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)