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
GeekAlfPro
Helper V
Helper V

datesbetween different by row

Hello,

 

I'm looking for a way to calculate a difference between two values.

so far so good.

Différence Kms CBu vs Capte = CALCULATE(
    [Somme Kms Electric Final CB]-[Somme Kms Electric Final],
    DATESBETWEEN('Date'[Date],FIRSTDATE('daily_aggregate_final'[Date]),MAX('BDD kms depuis 2019'[Date Kms]))
    )

But the result is not what i'm expecting

My question is the following

each row has a different date "FIRSTDATE('daily_aggregate_final'[Date]"

Do i have to make a calculatetable first ?

 

Thanks

2 REPLIES 2
Anonymous
Not applicable

Hi @GeekAlfPro 

Can you provide some sample data , because you mentioned that the dates are from different table, what are the relationship bwtween the tables? If you want to use the condition that the dates are the same, you can use filter() function to find the same date of the different table.

 

Best Regards!

Yolo Zhu

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

GeekAlfPro
Helper V
Helper V

Maybe i'm not accurate enough.

here is a table with different use cases

 

VehicleDate[Somme Kms Electric Final CB]Date[Somme Kms Electric Final]result
101/09/20221200024/01/2023750null
207/10/20221550007/10/20221545050
301/09/20222375601/09/2023210002756
415/12/2022782324/01/20233254null

 

GeekAlfPro_0-1678467364692.png

 

Actually, to make it easier to understand if dates of different tables are equals, so i need the result.

 

Thanks

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.

Top Solution Authors