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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
ArvindJha
Helper III
Helper III

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"
)
1 ACCEPTED SOLUTION

Hello @ArvindJha

Try creating a calculated column instead of measure based on the required condition, it will return "Yes" or "No" for each row. Once this calculated column is created, you can use it in your visuals and slicers to filter and display data according to whether the subject meets the specified criteria.

flag_column =
if(
sheet1[prevvalue] < [threshold value] && sheet1[currvalue] >= [threshold value],
"yes",
"no"
)

Thanks and Regards.

View solution in original post

14 REPLIES 14
Cookistador
Solution Sage
Solution Sage

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

thanks for sharing , this works but i also want to see list of subjects meeting that criteria in filter which is not happening if subject has both yes and no it does not work

ArvindJha_0-1743921212429.pngArvindJha_1-1743921240411.png

 

Hello @ArvindJha

Try creating a calculated column instead of measure based on the required condition, it will return "Yes" or "No" for each row. Once this calculated column is created, you can use it in your visuals and slicers to filter and display data according to whether the subject meets the specified criteria.

flag_column =
if(
sheet1[prevvalue] < [threshold value] && sheet1[currvalue] >= [threshold value],
"yes",
"no"
)

Thanks and Regards.

Thanks for the response , calculated column doesn't work in this case only measure works

ArvindJha
Helper III
Helper III

ArvindJha_0-1743671816123.png

 

static values work

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

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

 

Tried all the above steps still not working 

ArvindJha_0-1743676497905.png

 

ArvindJha_1-1743676538116.png

 

Cookistador
Solution Sage
Solution Sage

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

Even when i use as measure it does not work :

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

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

@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






Even when i use as measure it does not work :

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

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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