Forum Discussion
Applying a segmentation filter to a DAX formula
I need help to pass by parameter a Year value for a column or measure in DAX. So far I have only been able to indicate the minimum value of the year (2015), but what I need is not to have to indicate it manually but to change it with the segmentation filter. I need the average price for 2015 and the average price for 2020. I would like it to change as I change the value in the segmentation filter and not have to change it manually in the formula.
Thanks,
Isaac
icerdeira , You can use what if parameter
calculate(Avergae(Table[Value]), Filter(all(table), Table[Year] = [what if measure]))
3 Replies
- amitchandak
Super User
icerdeira , You can use what if parameter
calculate(Avergae(Table[Value]), Filter(all(table), Table[Year] = [what if measure]))
- icerdeiraFrequent Visitor
Hello amitchandak ,
Thanks for your answer. I'm trying to do it and it says: Need one more argument in my function.
I created a what if, with the years from 2006 to 2025 and make the relation and it works ok.
There is something wrong on my formula.
Thanks!
Isaac