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

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

the simpliest solution looks the best! thank you!

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.