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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Selecting the effective Rate for a specific Time Entry Date

Hi,

 

I have two tables,  Table A with effective Rates per Employees with Start Dates and Table B with Time Entries per Employees.

 

Sergec67_0-1658868361693.png

 

Sergec67_1-1658868387624.png

I would like to calculate the Cost = [Duration in Hours] * [Rate] but use the effective Rate at Date time Entry.  I've been struggling with that one.

Thanks

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

My test table:


Table A:

vbinbinyumsft_1-1659082712216.png

Table B:

vbinbinyumsft_2-1659082729365.png


Please try below measure:

Cost =
VAR cur_duration =
    SELECTEDVALUE ( 'Table B'[Duration in Hours] )
VAR cur_datetime =
    SELECTEDVALUE ( 'Table B'[Date time entry] )
VAR cur_num =
    SELECTEDVALUE ( 'Table B'[Employee Number] )
VAR cur_rate =
    CALCULATE (
        MAX ( 'Table A'[Rate] ),
        FILTER (
            'Table A',
            'Table A'[Employee number] = cur_num
                && 'Table A'[Effective Start Date] < cur_datetime
        )
    )
RETURN
    cur_duration * cur_rate

vbinbinyumsft_0-1659082678043.png

 

 

Best regards,
Community Support Team_ Binbin Yu
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

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

My test table:


Table A:

vbinbinyumsft_1-1659082712216.png

Table B:

vbinbinyumsft_2-1659082729365.png


Please try below measure:

Cost =
VAR cur_duration =
    SELECTEDVALUE ( 'Table B'[Duration in Hours] )
VAR cur_datetime =
    SELECTEDVALUE ( 'Table B'[Date time entry] )
VAR cur_num =
    SELECTEDVALUE ( 'Table B'[Employee Number] )
VAR cur_rate =
    CALCULATE (
        MAX ( 'Table A'[Rate] ),
        FILTER (
            'Table A',
            'Table A'[Employee number] = cur_num
                && 'Table A'[Effective Start Date] < cur_datetime
        )
    )
RETURN
    cur_duration * cur_rate

vbinbinyumsft_0-1659082678043.png

 

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

vapid128
Solution Specialist
Solution Specialist

In your second table add colnum

rate = 

Calculate(

    max(table1[Rate]),

    Filter(table1,

        table1[Employee Number] = table2[Employee Number] &&

        table1[date]<table2[date]
    )
)

Anonymous
Not applicable

Thank you the reply.  I was working on DAX measures but this will get me started.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.