Forum Discussion
Set Filter Based on DAX Measure
Thank you Anonymous for the reply. I am still a bit lost, however. Can you give me a bit more explanation or an example of what you mean by "use measure formula instead"? I believe I did create a measure formula (provided in my notes). Or are there different types of measures?
Thank you
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
- Kazoo606 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