Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
georgina261185
Frequent Visitor

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 2
amitchandak
Super User
Super User

@georgina261185 ,

 

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-fc4095ae9af...
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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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]))

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors