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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Raul
Post Patron
Post Patron

How can I join tables with a condition?

Hello everyone!

I have 2 tables (AREAS and CALENDAR) and I want to join this tables with a condition:

  • If year it's less or equal 2017, links with a values of the Areas tabla and
  • If year it's greater or equal 2018, links with anothers values of the Areas table

Something like this:

C1.JPG

 

So that when you filter for one year (for example 2017) you only show the values of that year (A1, A2 and A5) in another filter and when you filter for another year (for example 2018), your corresponding values (A1, A3, A4 and A5).

 

C2.JPGC3.JPG

 

Is it possible create a measure for this situation? Is it possible filter a slicer with a condition for this case? Or may be I have to create a third table to link the others two?

Thank you for your help.

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Raul

 

It is impossible to filter a slicer with a condition for this case. First way as you said, create a third table to link the others two. Second way, try to create a measure to get the table as requested. For example:

Measure  =
SWITCH (
    SELECTEDVALUE ( 'Calendar'[year] ),
    2017, IF ( MIN ( Area[Area] ) IN { "A1", "A2", "A5" }, 1 ),
    2018, IF ( MIN ( Area[Area] ) IN { "A1", "A3", "A4", "A5" }, 1 )
)

1.png

 

Regards,

Cherie

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

View solution in original post

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Raul

 

It is impossible to filter a slicer with a condition for this case. First way as you said, create a third table to link the others two. Second way, try to create a measure to get the table as requested. For example:

Measure  =
SWITCH (
    SELECTEDVALUE ( 'Calendar'[year] ),
    2017, IF ( MIN ( Area[Area] ) IN { "A1", "A2", "A5" }, 1 ),
    2018, IF ( MIN ( Area[Area] ) IN { "A1", "A3", "A4", "A5" }, 1 )
)

1.png

 

Regards,

Cherie

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

Thanks a lot @v-cherch-msft  for  your reply.

The second option, I think that can be works for me. 

See you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.