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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anish610
Frequent Visitor

How to filter product list based on Year selection on Slicer?

I want to filter a product List containing

  • Products A
  • Product B
  • Product C

for selected  Date year slicer 2022,

and it should display only 2 Products

  • Product A
  • Product B

for selected  Date year slicer 2023?

5 REPLIES 5
anish610
Frequent Visitor

@amitchandak  Any help here?

 

bolfri
Super User
Super User

Put a filter on the product slicer to show only product that has any value in the data. Simply and works perfect!

eg. if you have a measure Sales = SUM(...) put it on product filter with condition that Sales is not blank 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for the reply.
That cant work. As Product C does contain data for 2023. 
but by rule it should not be shown in 2023.

dim_product: (that is connected to fact_sales)

product_id, product_name etc.

dim_calendar (that is connected to fact_sales)

date, year, quarter ctc.

fact_product_dates (that is connected to dim_product with two directions)

product_id, year_start, year_end

 

Create a measure that checks if product from dim_product table and selected year is betweeen year_start and year_end and set 1 or 0 rule. Set filter on viz to 1. 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




marcelsmaglhaes
Super User
Super User

Hey @anish610 

You need to have some date reference in your product table. For example, a created date. Somehow, you need to create a relationship between the products and the specific year to achive your goal.

Kind Regards,
Marcel


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.