Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
How to write the below condtion in DAX.
case when
(date1 - Date2) > 7
then count distinct (Account Num)
else
0
I have written as below
Count AcctNumber=
Var Acc_cond = (FORMAT ( TODAY (), "YYYY-MM-DD" ) - FORMAT ( "Account"[Start Date], "YYYY-MM-DD" ))
Var CountDist =
CALCULATE(DISTINCTCOUNT('Account'[Account Number]),
Acc_cond > 7 )
RETURN if( Cond1> 7, CountDist, 0)
unalbe to get the data, getting below error
Thanks,
Solved! Go to Solution.
@ramshoney1225 , Try like
Count AcctNumber=
Var Acc_cond = (FORMAT ( TODAY (), "YYYY-MM-DD" ) - FORMAT ( "Account"[Start Date], "YYYY-MM-DD" ))
Var CountDist =
CALCULATE(DISTINCTCOUNT('Account'[Account Number]),Filter(Account, datediff(Account[Start Date],TODAY (),day)+1 >7))
RETURN CountDist
@ramshoney1225 , Try like
Count AcctNumber=
Var Acc_cond = (FORMAT ( TODAY (), "YYYY-MM-DD" ) - FORMAT ( "Account"[Start Date], "YYYY-MM-DD" ))
Var CountDist =
CALCULATE(DISTINCTCOUNT('Account'[Account Number]),Filter(Account, datediff(Account[Start Date],TODAY (),day)+1 >7))
RETURN CountDist
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
101 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
102 | |
81 | |
66 |