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

Need help to getting the correct rates based on dates

Hi all, 

Need some help to get the price of rates based on dates. 


Previously , i am using month to get the price of the rate but on some date of the month the rate price been changed and i need to get based on dates of calendar which i have created in another table.

 

Here are the table of rates with price:

Hairul_Khumaini_1-1669791702439.png

 

Here table with the calendar :

Hairul_Khumaini_2-1669792235474.png

 

Current output:

Hairul_Khumaini_3-1669792763625.png

 

Expected output :

I would like to use rate from dates before 10 november will using rate 0.435 and after will be using 0.380 (based on the first table) .  Need some help to achieve this. 

 

Thanks in advance 

 

1 ACCEPTED SOLUTION
TomasAndersson
Solution Sage
Solution Sage

You might have to adjust table/column names, but something like below. The measure looks for the latest entry in the Rates table that is on or before the current date.

CurrMonth First Tariff = 
CALCULATE(
    LOOKUPVALUE('Rates'[Rate],'Rates'[Start Date],maxx('Rates','Rates'[Start Date])),
    'Rates'[Description] = "For Tariff less than 200",
    FILTER(ALL(Calendar), Dates[Calendar]<=max(Calendar[Date])))

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Adjusted the columns to the correct one as @TomasAndersson said and it works . Thanks

TomasAndersson
Solution Sage
Solution Sage

You might have to adjust table/column names, but something like below. The measure looks for the latest entry in the Rates table that is on or before the current date.

CurrMonth First Tariff = 
CALCULATE(
    LOOKUPVALUE('Rates'[Rate],'Rates'[Start Date],maxx('Rates','Rates'[Start Date])),
    'Rates'[Description] = "For Tariff less than 200",
    FILTER(ALL(Calendar), Dates[Calendar]<=max(Calendar[Date])))

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors