Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is there a DAX function that test whether or not the target is in a column?
For example, ....(x, DATA) returns TRUE() or FALSE() whether or not x is in the column
DATA
1
2
3
4
5
6
...
Solved! Go to Solution.
Hey,
there are two functions I would start with. The 1st function is IN (actually IN is more like an operator then a function but nevertheless ...
You can use something like this
IF(15 IN VALUES('Calendar'[MonthNoIndex]) ,"Yes" ,"No" )
This little statement checks if 15 is contained in the table returned by VALUES(). Be aware that IN checks if something in a table.
This would also work
IF(15 IN {13, 14, 15} ,"Yes" ,"No" )
The 2nd function that can be of interest, could be CONTAINS().
I hope this gets you started.
Regards
Tom
Hi @quantfinRguy,
As @TomMartens posted, you you can create measure using IN function.
This is my sample table, please a measure using the formula below.
Measure = IF(4 IN VALUES(Test[Date]),"Yes","No")
Create a table visual to display the result.
For another thing, you can create a calculated column using the formula below to get expected result.
Column = IF(Test[Date]=4,"Yes","No")
Best Regards,
Angelia
Hi @quantfinRguy,
As @TomMartens posted, you you can create measure using IN function.
This is my sample table, please a measure using the formula below.
Measure = IF(4 IN VALUES(Test[Date]),"Yes","No")
Create a table visual to display the result.
For another thing, you can create a calculated column using the formula below to get expected result.
Column = IF(Test[Date]=4,"Yes","No")
Best Regards,
Angelia
Hey,
there are two functions I would start with. The 1st function is IN (actually IN is more like an operator then a function but nevertheless ...
You can use something like this
IF(15 IN VALUES('Calendar'[MonthNoIndex]) ,"Yes" ,"No" )
This little statement checks if 15 is contained in the table returned by VALUES(). Be aware that IN checks if something in a table.
This would also work
IF(15 IN {13, 14, 15} ,"Yes" ,"No" )
The 2nd function that can be of interest, could be CONTAINS().
I hope this gets you started.
Regards
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |