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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Abhanshu97
Frequent Visitor

How to match two unrelated dates tables using DAX ?

We have two tables - Table A and Table B

Table A contains the column of Employee ID(EID) and Date of Joining(DOJ).

Table B contains the column of Dates(Date) only.

There is no relationship between two tables.

Please suggest me how do I match the two tables such that if we select date slicer from Table B then it would change the data of Row card containing count of EID ?

I have tried using Lookupvalue but it didn't work.

 

Any help would be appreciated!!

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Abhanshu97 

You can try to build a measure to calculate the count of Employee ID in Table A based on the filter of unrelated Date table.

Table A:

1.png

Date Table:

Date = CALENDARAUTO()

They are unrelated.

3.png

If you want to select dates directly in date slicer, try this measure.

Measure = 
VAR _SelectValue = VALUES('Date'[Date])
VAR _Count = CALCULATE(COUNT('Table A'[Employee ID]),FILTER(ALL('Table A'),'Table A'[Date] in _SelectValue))
RETURN
_Count

By default, no selection in date slicer, result should return to 8.

2.png

In silcer I select 2021/05/10 and 2021/07/05, result should return to 3.

1.png

If you want to filter Table A by between function in unrelated date slicer, try this measure.

Measure 2 = 
VAR _RangeStart = MIN('Date'[Date])
VAR _RangeEnd = MAX('Date'[Date])
VAR _Count = CALCULATE(COUNT('Table A'[Employee ID]),FILTER(ALL('Table A'),AND('Table A'[Date]>=_RangeStart,'Table A'[Date]<=_RangeEnd)))
RETURN
_Count

By default:

1.png

Range between 2021/05/10 and 2021/07/05:

2.png

Best Regards,

Rico Zhou

 

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

Hello @Anonymous,

 

Thanks a ton, for your help. I really appreciate it.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Abhanshu97 

You can try to build a measure to calculate the count of Employee ID in Table A based on the filter of unrelated Date table.

Table A:

1.png

Date Table:

Date = CALENDARAUTO()

They are unrelated.

3.png

If you want to select dates directly in date slicer, try this measure.

Measure = 
VAR _SelectValue = VALUES('Date'[Date])
VAR _Count = CALCULATE(COUNT('Table A'[Employee ID]),FILTER(ALL('Table A'),'Table A'[Date] in _SelectValue))
RETURN
_Count

By default, no selection in date slicer, result should return to 8.

2.png

In silcer I select 2021/05/10 and 2021/07/05, result should return to 3.

1.png

If you want to filter Table A by between function in unrelated date slicer, try this measure.

Measure 2 = 
VAR _RangeStart = MIN('Date'[Date])
VAR _RangeEnd = MAX('Date'[Date])
VAR _Count = CALCULATE(COUNT('Table A'[Employee ID]),FILTER(ALL('Table A'),AND('Table A'[Date]>=_RangeStart,'Table A'[Date]<=_RangeEnd)))
RETURN
_Count

By default:

1.png

Range between 2021/05/10 and 2021/07/05:

2.png

Best Regards,

Rico Zhou

 

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

Hello @Anonymous,

 

Thanks a ton, for your help. I really appreciate it.

Portrek
Resolver III
Resolver III

Hi Abhanshu97

 

Make a relationship between the tables, join the Date[date] and Date of joininid columns. By doing this the slicer will change your row card

 

Best regards

Thanks Portrek!

 

But here the problem is that, we can't create the relationship between tables. I mean we only have to use DAX to match the tables.

 

Is that be possible to do so with DAX?

Without relationships I find it very difficult to get. Good luck !

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.