The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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.
Maybe i'm not accurate enough.
here is a table with different use cases
Vehicle | Date | [Somme Kms Electric Final CB] | Date | [Somme Kms Electric Final] | result |
1 | 01/09/2022 | 12000 | 24/01/2023 | 750 | null |
2 | 07/10/2022 | 15500 | 07/10/2022 | 15450 | 50 |
3 | 01/09/2022 | 23756 | 01/09/2023 | 21000 | 2756 |
4 | 15/12/2022 | 7823 | 24/01/2023 | 3254 | null |
Actually, to make it easier to understand if dates of different tables are equals, so i need the result.
Thanks