Forum Discussion
Set Filter Based on DAX Measure
HI Kazoo60,
Current power bi does not support to create dynamic calculate column/table based on filter/slicers. Please use the measure formula instead. (measure, filter/slicer and calculate column work on different data levels, you can't use child level to interact with its parent)
Regards,
Xiaoxin Sheng
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
- Anonymous6 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 BIRegards,
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