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!View all the Fabric Data Days sessions on demand. View schedule
This SQL Script please how can this be written in DAX
SELECT
(TO_CHAR(DATE_TRUNC('month', CONVERT_TIMEZONE('UTC', 'Europe/London', CAST(store_open AS TIMESTAMP_NTZ))), 'YYYY-MM')) AS "scheduled_month",
( COUNT(DISTINCT case
when Year_sales != No Sales'
or (case
when Store_Close = 1 then true
when Store_Close = 0 then false
end) = true
then Store_ID
else null
end ) ) * 1.0
/ nullif(( COUNT(*) ),0)
Really hard to help with the info given.
Would need to see the complete SQL, your current data model/relationships, and preferably, some sample data from the relevant tables.
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
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!