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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Get Limit value from table 2 by comparing date from table 1

Hi,

I have 2 tables like below:

 

Onkar__22_0-1690179236849.png

 

Onkar__22_1-1690179267927.png

 

I want to ftech the limit1, limit2, limit3 by comparing date & Site Name from table 1 with date range in table 2.

i.e. It should check the date range in which the date fits; also, if the site name matches, return the values from that row.

1 ACCEPTED SOLUTION
sanalytics
Solution Supplier
Solution Supplier

Hello @Anonymous 

 

Assuming you want to compare Table1[Date] with Table2[StartDate] and Table2[EndDate] range.

If it is then please get the below solution

Create a calculated column by writing below DAX

Limit 1 =
CALCULATE(
    MAX( Table2[Limit1] ),
    FILTER(
        Table2,
        Table1[SiteName] = Table2[SiteName] &&
        Table1[Date] >= Table2[StartDate] &&
        Table1[Date] <= Table2[EndDate]
    ) )
 
Please find the below screenshot
sanalytics_0-1690181673696.png

 

Hope it will help you.

 

Regards

sanalytics

If it is your solution then please like and accept it as solution

 

 

 

View solution in original post

3 REPLIES 3
sanalytics
Solution Supplier
Solution Supplier

Hello @Anonymous 

 

Assuming you want to compare Table1[Date] with Table2[StartDate] and Table2[EndDate] range.

If it is then please get the below solution

Create a calculated column by writing below DAX

Limit 1 =
CALCULATE(
    MAX( Table2[Limit1] ),
    FILTER(
        Table2,
        Table1[SiteName] = Table2[SiteName] &&
        Table1[Date] >= Table2[StartDate] &&
        Table1[Date] <= Table2[EndDate]
    ) )
 
Please find the below screenshot
sanalytics_0-1690181673696.png

 

Hope it will help you.

 

Regards

sanalytics

If it is your solution then please like and accept it as solution

 

 

 

Anonymous
Not applicable

Thanks @sanalytics 🙂

@Anonymous 

Glad, it worked. Would appreciate if you like the solution.

 

Regards

sanalytics

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.