Forum Discussion
Count Number Of Events per date value MEASURE
- 9 years ago
Hi dstead0610,
For your expected result, it should be 4 for 03-01-2017, which includes 000001,000002,000003,000004 based on my understanding.
I try to reproduce your scenario using the following table sample table and get expected result.Please create a measure to get each date in date table. You can use Max, min , or average, because they are same for unique row in table.
get date = MAX('Date'[DATE])
Then create a measure to calculated number of "Occupied rooms" per calendar date.Occupied rooms = CALCULATE(COUNTA(FactTable[BOOKINGID ]),FILTER(FactTable,FactTable[DateIN]<='Date'[get date]&&FactTable[DateOUT]>='Date'[get date]))
Create a table visual, select the Date[Date] and measure as value, please see the following screenshot.
Please let me know if you have any question.
Best Regards,
Angelia
Hi dstead0610,
For your expected result, it should be 4 for 03-01-2017, which includes 000001,000002,000003,000004 based on my understanding.
I try to reproduce your scenario using the following table sample table and get expected result.
Please create a measure to get each date in date table. You can use Max, min , or average, because they are same for unique row in table.
get date = MAX('Date'[DATE])
Then create a measure to calculated number of "Occupied rooms" per calendar date.
Occupied rooms = CALCULATE(COUNTA(FactTable[BOOKINGID ]),FILTER(FactTable,FactTable[DateIN]<='Date'[get date]&&FactTable[DateOUT]>='Date'[get date]))
Create a table visual, select the Date[Date] and measure as value, please see the following screenshot.
Please let me know if you have any question.
Best Regards,
Angelia
I need to change my model a little bit due to that i have relationships between both tables, but works great!