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
IF(DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>5
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=10 )
then
'6-10 Days'
ELSEIF (DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>=4
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=5)
then
'4-5 Days'
ELSEIF (DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>=0
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=3 )
then
'0-3 Days'
ELSE
'>10 DAYS'
END
Solved! Go to Solution.
Few ways to do this - could always just make a custom column finding the date difference and then grouping on the results, or make a column like this:
Could probably do it as a measure as well
IF(DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>5
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=10 )
then
'6-10 Days'
ELSEIF (DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>=4
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=5)
then
'4-5 Days'
ELSEIF (DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])>=0
AND DATEDIFF('day',[Min StartDate Per Payload],[Max EndDate per PayloadID])<=3 )
then
'0-3 Days'
ELSE
'>10 DAYS'
END
Few ways to do this - could always just make a custom column finding the date difference and then grouping on the results, or make a column like this:
Could probably do it as a measure as well
Hi there. The syntax in DAX should be like this
How it works "IF(Condition, TRUE, FALSE)"
IF(AND(Condition1, Condition2), "ResultTrue", IF(AND(Condition1, Condition2), "ResultTrue", IF( .... ) ) )
Check that the FALSE is your ELSEIF statement.
You can also do it on Power Query M. But it could be more complex the change due to Datediff function.
Regards,
Happy to help!
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!