Forum Discussion
Set Store open/close status when selecting multiple Dates
How are we to solve this puzzle without knowing how you produce the statuses for different time periods? Any idea?
HIi Anonymous ,
Sorry i didnt get your question. I am getting the store status using a measure which checks the sales for a day and when i select the day in calander slicer it shows correctly ,if store has no sales it shows as "Close" but when i check for multiple days it is not showing "Close" which is my requirement( if a store has zero sales in a any of the selected day the store status should be set to "close"). I hope i made it clare.
This is the measuere i use
- Mohammad_Refaei5 years ago
Solution Specialist
I understand that you want to flag the week as closed if it it closed in any day.
Then you probably need to write a measure like:
Weekly Status = VAR DailyStaus = ADDCOLUMNS ( SUMMARIZE ( 'Calendar', 'Calendar'[Date] ), "Status", [Open/Close] ) RETURN IF ( CALCULATE ( COUNTROWS ( DailyStatus ), [Status] = 0 ) >= 1, "Close", "Open" )- samHil5 years agoFrequent Visitor
Hi Mohammad_Refaei ,
I think this is the logic am looking for but the code is having error --"The value for 'Status' cannot be determined. Either the column doesn't exist, or there is no current row for this column."
- Mohammad_Refaei5 years ago
Solution Specialist
It will help if you share your model table structure and measures
- Anonymous5 years agoNot applicable
[Open/Close] = var HasNoClosedStatus = CALCULATE( ISEMPTY( T ), // T is your fact table with statuses KEEPFILTERS( T[Status] = "close" ) ) var Result = if( HasNoClosedStatus, "open", "closed" ) return Result- samHil5 years agoFrequent Visitor
Anonymous,
Status is determined by a measure.
Here is the detail
There are 3 Measures1 Open/Close =Var __Year__Check = if([GS]=0 && [GS Prev]<>0,"0","1")Return__Year__Check2 GS = sum('pxprod'[GrossSales])3 GS Prev = CALCULATE([GS],DATEADD(Calender_Lookup[Date].[Date],-1,YEAR))
The repport is like thisThere are 3 tables
1, Calender_Lookup -- where the date is taken for slicer
2,Location_Lookup -- store is taken for the table
3,Sales -- the sales for each day is taken
Hope this will give yo a better idea.
Sales table is linked to Calender_lookup with date
Sales table is liked to location with store nameThanks in advance