Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi!
I have matrix. It is looks like this:
| date | date1 | date1 | date2 | date2 |
| branch | Sales | Count_of_sales | Sales | Count_of_sales |
| branch1 | Measure1 | Measure2 | Measure1 | Measure2 |
| Branch2 | Measure1 | Measure2 | Measure1 | Measure2 |
The Measure1 must calculate total sales between dates in header. The left date border must not be incluaded, the right border must be incluaded.
For examle:
If headers looks like 2022-06-22, 2022-06-24
For date 2022-06-24 Measure must calculated sum from 2022-06-22 to 2022-06-24. The boarders - (2022-06-22, 2022-06-24]
I can`t hardcode 2 days in measure, because headers depends on user selection, it can by day by day, week by week, some specific dates.
My data sample looks like:
| Date | Branch | Order_id | Sales | Revenue |
| Date1 | Branch1 | 1 | 10 | 100 |
| Date2 | Branch1 | 2 | 15 | 150 |
| etc | etc | etc | etc | etc |
Any idea how realize that?
Hi @Fatman121 ,
Please have a try.
Create a calendar date table first.
date=calendar(date(2021,1,1),date(2022,12,31))
Then put the date column into the slicer.
Then create a measure.
measure=var _selemindate=selectedvalue('table'[date])
var _selemax=selectedvalue('date'[date])
return
calculate(sum('table[value]),filter(all('table'),'table'[order]=selectedvalue('table'[order])&&'table'[date]>_selemindate&&'table'[date]<=_selemax))
If I have misundetstood, please provide more details with your desired output and some sample data.
How to Get Your Question Answered Quickly
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!