Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |