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

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

Reply
mic_rys
Helper I
Helper I

Create one filter for two columns with Year

Hi,

I have problem how to create "global year filter"

table:

Proj nameimplementeddeleted
Project 12010 
Project 220112014
Project 320122015
Project 42013 
Project 52014 

 

And i have 2 measures which show number of implemented and deleted projects:

Measure1 :

yearNumer of implemented
20101
20111
20121
20131
20141

 

Measure2

yearNumer of deleted
20141
20151

 

I would like to create filter Year. For example if i choose 2014 measure should show:

yearNumer of implemented
20141

 

yearNumer of deleted
20141

 

I tried with this way https://www.sqlbi.com/articles/creating-a-slicer-that-filters-multiple-columns-in-power-bi/

but if I choose "2014" it shows:

yearNumer of implemented
20111
20141

 

Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mic_rys , I think you have to create a common year table and join it both years. One will be inactive, You can active that in measure using use relationship

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

This with date, you need for Year

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

New Table

Year = distinct(union(distinct(Table[implemented]),distinct(Table[deleted])))
Assume active join implemented

measure
implemented = countrows(Table)

deleted = calculate(countrows(Table), userelationship(Table[deleted], Year[implemented]))

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mic_rys , I think you have to create a common year table and join it both years. One will be inactive, You can active that in measure using use relationship

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

This with date, you need for Year

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

New Table

Year = distinct(union(distinct(Table[implemented]),distinct(Table[deleted])))
Assume active join implemented

measure
implemented = countrows(Table)

deleted = calculate(countrows(Table), userelationship(Table[deleted], Year[implemented]))

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

the simpliest solution looks the best! thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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