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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have table with custid, createddate and cancelled date. I want to create a calcualted measure using DAX for couting number of custid's WHERE createdate is BETWEEN April1st - March31t financial year BUT EXCLUDE those custid's WHERE cancelled date is BETWEEN April1st - March31t financial year.
Can someone please help me with that DAX query ? Many Thanks
Solved! Go to Solution.
@Anonymous , Assume you use a date table and FY is column in date table and it is selected in a slicer
If date table is independent and joined to any of these columns
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
calculate(count(Table[customer_id]), filter(Table, Table[createdate] >=Min && Table[createdate] <=Max && Table[cancelled date] >=Min && Table[cancelled date] <=Max ))
And if date table is joined to createdate
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
calculate(count(Table[customer_id]), filter(Table, Table[cancelled date] >=Min && Table[cancelled date] <=Max ))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi Amit, But I cannot see your query filtering for the below conditon for both created and cancelled date . Am i missing something ?
BETWEEN April1st - March31t
Hi Thanks Amit. Yes I have a seperate DATE table in my model and its got relation with both those columns. ACTIVE relation on the created date and non-active relation on the cancelled date.
Thanks
@Anonymous , Assume you use a date table and FY is column in date table and it is selected in a slicer
If date table is independent and joined to any of these columns
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
calculate(count(Table[customer_id]), filter(Table, Table[createdate] >=Min && Table[createdate] <=Max && Table[cancelled date] >=Min && Table[cancelled date] <=Max ))
And if date table is joined to createdate
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
calculate(count(Table[customer_id]), filter(Table, Table[cancelled date] >=Min && Table[cancelled date] <=Max ))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
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!