Forum Discussion
Problem with IF DAX Funtion!
- Anonymous2 years ago
Hi TrongPhuoc ,
Please try below steps:
1. create measure with below dax formula
Measure = VAR max_date = MAXX ( ALL ( 'Table' ), 'Table'[Date] ) VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Date] = max_date ) VAR max_val = MAXX ( tmp, [CriticalVal] ) VAR _a = CALCULATETABLE ( VALUES ( 'Table'[order1] ), FILTER ( tmp, [CriticalVal] = max_val ) ) VAR cur_date = SELECTEDVALUE ( 'Table'[Date] ) VAR cur_order = SELECTEDVALUE ( 'Table'[order1] ) RETURN IF ( AND ( cur_date = max_date, cur_order IN _a ), 1 )Measure 2 = VAR max_date = MAXX ( ALL ( 'Table' ), 'Table'[Date] ) VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Date] = max_date ) VAR max_val = MAXX ( tmp, [CriticalVal] ) RETURN IF ( MAX ( 'Table'[CriticalVal] ) = max_val, "red" )2. add table visual with fields
3. set visual level filter and conditional format for font color
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 1 year ago
Thank you very much!
Hi Anonymous ,
I have tried your suggestion, but it didn't work like my expectation.
Here the results:
Is there anyway we can apply loop for this case?
Best regards,
TrongPhuoc
- Anonymous2 years agoNot applicable
Hi TrongPhuoc ,
In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?
Thanks for your efforts & time in advance.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.