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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors