Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Solved! Go to Solution.
@icerdeira , You can use what if parameter
calculate(Avergae(Table[Value]), Filter(all(table), Table[Year] = [what if measure]))
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
@icerdeira , You can use what if parameter
calculate(Avergae(Table[Value]), Filter(all(table), Table[Year] = [what if measure]))
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
Hi @icerdeira ,
Closing parenthesis is missing after ALL('Mercado' and there is an extra closing parenthesis at the end of the expression.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |