Forum Discussion
Set Store open/close status when selecting multiple Dates
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
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
- samHil5 years agoFrequent Visitor
Hi Mohammad_Refaei ,
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
- Anonymous5 years agoNot applicable
Or like this:
[Open/Close] = var HasNoClosedStatus = ISEMPTY( // Then, see if the result // is empty. If it is, all // days have sales and the // return status should be // "open". Otherwise, "close". FILTER( // First try to find dates // for which the fact table // is empty in the current // context, meaning no sales. DISTINCT( T[Date] ), CALCULATE( ISEMPTY( T ) ) ) ) var Result = if( HasNoClosedStatus, "open", "closed" ) return Result