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
Carmen
New Member

One slicer for two visualizations

Hello,

I hope I will be able to explain my problem in a clear way:

I need to use just one slicer in order to select a year. The problem is that I would like to use this slicer for two different visualizations, one showing the data related to the year selected in the slicer and the other one, showing the same data for the previous year selected. I would like to personalize the second graph so that it shows the selected year minus one. 

Is there any way of doing this? any DAX solution? THANK YOU!!!

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Carmen,

 


Can you mark the proper answer as a solution please?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Carmen,

 

If you don't want to duplicate your tables, you have to create an independent date table, which means no relationships established to other tables. Then you can create two measure to filter whether the year is the current year or the previous year. 

Can you share a sample? The DAX could depend on your data model. The solution could be like below.

measure =
IF ( YEAR ( MIN ( 'table'[date] ) ) = MIN ( 'datetable'[year] ), 1, 0 )

Then hide these values "0".

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.