I have a report calling a fixed room count per property from my properties table:
Each row is dedicated to an individual property, and the room count available on a daily basis specified. Using the below measures & filters I am able to calculate the rooms available in a filterable date period:
However, I now have to contend with room values changing over time. Is there a means of calling the different values per days in the filtered date range, without dedicating individual property columns to my date table (see last pic), using something along the lines of an accompanying RoomCount table? see below for example:
Using "Property 1" as an example, the calculation would essentially be able to discern, where a filtered date range of 01/01/2014-10/01/2014 was specified, that ((6 days*20 rooms)+(4 days*50 rooms)) was the desired calculation.
Again, trying to avoid the requirement for the below, as the date range and each additional property added will add to the data source size and impact calculation + response time.
All feedback appreciated.
I'd like to suggest you create a calendar table with full date range, then use calendar date and property name column to create matrix with measure as value field.(calendar not has relationship to original table)
Calendar = CALENDAR ( MIN ( VALUES ( Table[From] ) ), MAX ( VALUES ( Table[To] ) ) )
RoomCount = VAR _currentDate = SELECTEDVALUE ( Calendar[Date] ) RETURN CALCULATE ( SUM ( Table[Room Count] ), FILTER ( ALL ( Table ), _currentDate IN CALENDAR ( Table[From], Table[To] ) ), VALUES ( Table[Property Name] ) )
In addition, you can also try to expand date column to getdate date to create visualization.
This is looking promising so far!
Can I ask a few questions regarding the solution to date:
Again, @v-shex-msft thanks for the help so far, it is definitely progressing.
#1. You can also use existed calendar table to replace steps and formula what I told about.
#2. Nope, calendar only used to get current date value to compare with two date column from fact table, relationship not the required.
#3. Unfortunately, 'in' operation not works to compare many to many records, it only support one to many.
It you want to compare with summarized records, I think create a expand table should be suitable for your requirement.