Forum Discussion
Using another table (e.g., holidays) to filter a calendar table
- 1 year ago
MJEnnis From your last image, it does look like it is having an effect. Everything other than the 04/04/2015 row is all 0's so something is going on. If you want rows to not show up you could use a Complex Selector. The Complex Selector - Microsoft Fabric Community
- 1 year ago
Figured it out! Your complex selector post was helpful, but the solution was much simpler in my case. I have a measure that calculates the total number of any given product available on any given calendar day, considering the start and end season for each product. All I had to do was tell my existing measures to return a blank if the [units available] measure was blank. Works like a charm, as you can see below. Still have no clue why it replaces all other dates with 0 without this condition. But not going to rack my brain anymore... 😄 Thanks again! Just chatting with you seems to lead me to a solution everytime!
New measure (guess I will test if the first condition is redundant now, since it already passes through [units available]):Vacancy = Var OPEN_Date = MIN('Lista Tipologie delle Risorse'[InizioStagione]) Var Close_Date = MAX('Lista Tipologie delle Risorse'[FineStagione]) Var d = MAX('Calendar'[Date]) VAR vacancy_ = [Units Available] - [Occupancy] RETURN IF(d < OPEN_Date || d > Close_Date, BLANK(), IF(ISBLANK([Units Available]), BLANK(),vacancy_))
Screenshot of it working:
MJEnnis From your last image, it does look like it is having an effect. Everything other than the 04/04/2015 row is all 0's so something is going on. If you want rows to not show up you could use a Complex Selector. The Complex Selector - Microsoft Fabric Community
Figured it out! Your complex selector post was helpful, but the solution was much simpler in my case. I have a measure that calculates the total number of any given product available on any given calendar day, considering the start and end season for each product. All I had to do was tell my existing measures to return a blank if the [units available] measure was blank. Works like a charm, as you can see below. Still have no clue why it replaces all other dates with 0 without this condition. But not going to rack my brain anymore... 😄 Thanks again! Just chatting with you seems to lead me to a solution everytime!
New measure (guess I will test if the first condition is redundant now, since it already passes through [units available]):
Vacancy =
Var OPEN_Date = MIN('Lista Tipologie delle Risorse'[InizioStagione])
Var Close_Date = MAX('Lista Tipologie delle Risorse'[FineStagione])
Var d = MAX('Calendar'[Date])
VAR vacancy_ = [Units Available] - [Occupancy]
RETURN IF(d < OPEN_Date || d > Close_Date, BLANK(), IF(ISBLANK([Units Available]), BLANK(),vacancy_))
Screenshot of it working: