Forum Discussion
DAX Measure for conditional formatting - problem with filter context
Hi,
On another post I found a solution to create a measure that can be used for conditional formatting:
I assume I need to use something like KEEPFILTERS on the VAR _SELName?? But I can't work out the syntax.
- Anonymous4 years ago
Hi andybrace ,
You could add the filter conditions by using CALCULATETABLE() and FILTER() function.
For example:
VAR _SELName =
CALCULATETABLE (
VALUES ( 'tbl_MD_Business Matrix for Summary'[Global SBU - Std#] ),
FILTER (
ALLSELECTED ( 'tbl_MD_Business Matrix for Summary' ),
'tbl_MD_Business Matrix for Summary'[business]
= SELECTEDVALUE ( 'alternate'[business] )
)
)Best Regards,
Jay
2 Replies
- lbendlinSuper User
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Hi andybrace ,
You could add the filter conditions by using CALCULATETABLE() and FILTER() function.
For example:
VAR _SELName =
CALCULATETABLE (
VALUES ( 'tbl_MD_Business Matrix for Summary'[Global SBU - Std#] ),
FILTER (
ALLSELECTED ( 'tbl_MD_Business Matrix for Summary' ),
'tbl_MD_Business Matrix for Summary'[business]
= SELECTEDVALUE ( 'alternate'[business] )
)
)Best Regards,
Jay