Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I need to get a count of closed stores where closed is defined as a store with less than $100 in sales for any given day. The tricky part is that certain stores always close on Sunday and these stores need to be excluded from the count, but only on Sundays. If they close on a Tuesday, they need to be included in the count.
Here's what I have so far. It seems to give me the correct counts by day, but the total is incorrect. Any help would be appreciated.
TempClosure =
CALCULATE (
COUNTROWS (
FILTER (
SUMMARIZE (
Sales,
Sales[Date],
Sales[Store],
"ClosedFlag", IF ( SUM ( Sales[SalesNet] ) < 100, 1, 0 ),
"SpecialStoreFlag", IF ( Sales[RestaurantKey] IN { 001, 002 }, 1, 0 ),
"SpecialDayFlag", IF ( SELECTEDVALUE ( 'DATE'[DayNameInt] ) = 1, 1, 0 )
),
[ClosedFlag] = 1
&& ( [SpecialStoreFlag] = 0
&& [SpecialDayFlag] = 0 )
|| ( [SpecialStoreFlag] = 1
&& [SpecialDayFlag] = 0 )
|| ( [SpecialStoreFlag] = 0
&& [SpecialDayFlag] = 1 )
)
)
)
In the above code I feel that the first three rows of the filter expression should suffice, but then I lose all sundays or all days for the special stores.
Solved! Go to Solution.
@DaHolla , Try a measure like
TempClosure =
CALCULATE (
Sumx (
SUMMARIZE (
Sales,
Sales[Date],
sales([Day of Week]) , // Create a new column weekday([Date],2)
Sales[Store],
"Sales", SUM ( Sales[SalesNet] )
),
Switch(true() , ([Sales] <100 && [Day of Week] <> 7) , 1, 0
)
)
)
@DaHolla , Try a measure like
TempClosure =
CALCULATE (
Sumx (
SUMMARIZE (
Sales,
Sales[Date],
sales([Day of Week]) , // Create a new column weekday([Date],2)
Sales[Store],
"Sales", SUM ( Sales[SalesNet] )
),
Switch(true() , ([Sales] <100 && [Day of Week] <> 7) , 1, 0
)
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 31 | |
| 20 | |
| 12 | |
| 12 |