Forum Discussion
Field Parameter - Filtered value within the Parameter
Hi all
I have a matrix visual that has
Rows = Customer Names
Columns =Parameter
Values = sales
I want the report user to use the parameter slice to switch between a month view and a year view.
When month view is selected it shows the sales for ALL years. I want it to show current year only.
How can I build this into the parameter? I need it to be filtered to only show data for the current year without the report user having to select the year.
Many thanks
2 Replies
- amitchandakSuper User
You have switch these two measure like I have done TOPN. You do need separate measures, check the code at the end
Assume you have measure m1 , use that for year
for month
calculate([M1], filter(Table, year(Table[Date]) = year(today()) )
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
others
Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Field Parameters- Conditional Formatting: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf- georgina261185Frequent Visitor
Hi Amitchandak
Thank you for your help. I have tried your solution but I get this error message
A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
This is the code i have used - [sell-out Qty] is sales
Switch Sell-Out = switch([Selected parameter],"Mth",calculate([sell-out qty],filter('Posting Date','Posting Date'[Year]=year(today())),[Sell-Out Qty]))