Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello!
I have a dataset of values between two dates like this, but much larger:
Customer | Start | End | Sum |
1 | 1.5.2020 | 31.5.2020 | 100 |
2 | 14.5.2020 | 31.5.2020 | 100 |
3 | 1.6.2020 | 30.6.2020 | 200 |
4 | 1.5.2020 | 30.6.2020 | 300 |
I would like calculate how much sum is active on each day. For example, sum on 1.5.2020 is 100 + 300 = 400 (customer 1 and 4 are active) and sum on 14.5.2020 is 100 + 100 + 300 = 500. In the end there should be a calendar table of each date between for example 1.5.2020 - 30.6.2020 and a column which shows the active sum per date. How can I do this on Power BI?
Try to create a data table not connected using like a filter.
Then create a measure:
MEASURE =
SUMX(
Table
,IF(MIN(TableDate[date]) <= MIN(Table[Start]) and MAX(TableDate[date]) >= MAX(Table[End]), SUM(Table[Sum]), BLANK())
)
I hope I have been helpful.
It's more easier to help you if you upload your pbix.
Mark it as a solution if resolve your problem.
Ciao!
User | Count |
---|---|
98 | |
91 | |
84 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |