Forum Discussion
Kazoo60
6 years agoFrequent Visitor
Set Filter Based on DAX Measure
I am new to Power BI. I am working with a table of work items and need to return items which meet either of 2 conditions: 1) either the work item is scheduled for a week the user selects from a slic...
Anonymous
6 years agoNot applicable
Hi Kazoo60,
After I check on your DAX formula, I found you are using values function to extract current row content values from the table field. AFAIK, VALUES function can be used to extract aggerated row content that may contain a single value or list of values. (Power bi does not allow you to use math operators to compare list types of value with a single value)
You can try to use the following measure formulas if it suitable for your scenario:
InSelectedWeekOrLate =
VAR WkEndingDate =
MAX ( CurrentWkEndingDate[WkEndingDate] )
VAR currStatus =
SELECTEDVALUE ( TaskResourceAssignment[AssignedTaskStatus] )
VAR FinishWkEndingDate =
VALUES ( TaskResourceAssignment[FinishWkEndingDate] )
VAR StartWkEndingDate =
VALUES ( TaskResourceAssignment[StartWkEndingDate] )
RETURN
IF (
WkEndingDate IN UNION ( FinishWkEndingDate, StartWkEndingDate ),
"yes",
IF ( currStatus = "Late", "yes", "no" )
)
For measure formulas, you can use them on the visual level filter to filter records:
Applying a measure filter in Power BI
Regards,
Xiaoxin Sheng
Kazoo60
6 years agoFrequent Visitor
Thank you! I have learned a lot about DAX syntax and strategy from the function you provided. And yes - it does address the issue.
Tim