Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi
I need to calculate the total sales between two dates and this comes from 2x revenue columns & 2 different date columns, example below.
What formula can I use to have the SCDATE & INVDATE search between 01/07/2023 – 30/06/2024 and then sum SCTOTAL & INVVAL to find the final value.
| SERVCARDID | SCTOTAL | SCDATE | INVVALUE | INVDATE |
| 123546 | 30.56 | 26/05/2024 | ||
| 789456 | 115.30 | 1/03/2024 | ||
| 947707 | 20.8 | 28/06/2024 |
Thanks,
Solved! Go to Solution.
Hi @dhodgson ,
I made simple samples and you can check the results below:
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dhodgson ,
I made simple samples and you can check the results below:
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dhodgson
Should the time frame be dynamic? If you have a date table in your data model, this solution is dynamic.
SC Sales = SUM(Table1[SCTotal])Invoice Sales =
CALCULATE(
SUM(Table1[INVVALUE]),
USERELATIONSHIP(Date[Date], Table1[INVDATE])Total Sales =
[SC Sales] + [Invoice Sales]
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Measure for SCTOTAL filtered by SCDATE
Total_SCTOTAL =
CALCULATE(
SUM('YourTable'[SCTOTAL]),
FILTER(
'YourTable',
'YourTable'[SCDATE] >= DATE(2023, 7, 1) &&
'YourTable'[SCDATE] <= DATE(2024, 6, 30)
)
)Measure for INVVALUE filtered by INVDATE
Total_INVVALUE =
CALCULATE(
SUM('YourTable'[INVVALUE]),
FILTER(
'YourTable',
'YourTable'[INVDATE] >= DATE(2023, 7, 1) &&
'YourTable'[INVDATE] <= DATE(2024, 6, 30)
)
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |