The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I have 3 columns - Custid, Reservation Date and Cancellation Date and below is the requirement.
I want to get Count of Custid WHERE Reservation date is in last 4 weeks from todays date WHERE there is no Cancellation date
Can someone please give me this DAX query ?
Many Thanks
Solved! Go to Solution.
Hi, @Anonymous
Please try to use the below.
if it is not working, please kindly share a sample data then I can look into it to come up with more accurate measure.
I am using a custom-date-table that contains the week-offset-number column. It is very useful when calculating week-related things.
Jihwan Kim
If this post helps, then please consider accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Please try to use the below.
if it is not working, please kindly share a sample data then I can look into it to come up with more accurate measure.
I am using a custom-date-table that contains the week-offset-number column. It is very useful when calculating week-related things.
Jihwan Kim
If this post helps, then please consider accept it as the solution to help the other members find it more quickly.
Hello @Anonymous ,
you can achieve that with the CALCULATE function:
Count Custid =
CALCULATE(
COUNT( myTable[Custid] ),
myDate[Cancellation] <> BLANK(),
DATEDIFF( myDate[Reservation date], TODAY(), DAY ) <= 28
)