Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!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
Hi Team,
Below is data
ID | Subject | PrevValue | CurrValue |
1 | 123 | 25 | 27 |
1 | 123 | 24 | 24 |
Below DAX works :
Solved! Go to 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.
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
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
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
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
Result with a higher value
Tried all the above steps still not working
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 :
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
@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"
)
Proud to be a Super User! |
|
Even when i use as measure it does not work :
User | Count |
---|---|
87 | |
74 | |
69 | |
58 | |
55 |
User | Count |
---|---|
40 | |
38 | |
34 | |
32 | |
30 |