Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi all,
I'm trying to write an expression that looks at a target date and will return answers based on the following:
- "overdue" (where target date is before today)
- "due in next 7 days" (where target date is between 0-7 days from today)
- "due 8-14 Days" (where target date is today + 8-14 days)
- "due 15-21 Days" (where target date is today + 15-21 days)
- "out for consultation" (where target date is today + 22 days)
I tried the following:
The "overdue" part worked but the "Due in Next 7 Days" and "7+ Days" are the wrong way around... I think!
Anyone out there able to help please?
Many thanks in advance,
Emma
Solved! Go to Solution.
Hello @hawkeye159 ,
Using Switch function will in power bi is more readable and easy to understand, I have re-written a dummy measure using switch instead of IF , kindly check if this works and try to replace this columns names in measure to your column names.
Testing Timeline =
SWITCH(
TRUE(),
[DETERMINATION DATE] < TODAY(), "Overdue",
AND([DETERMINATION DATE] >= TODAY(), [DETERMINATION DATE] <= TODAY() + 7), "Due in Next 7 Days",
AND([DETERMINATION DATE] > TODAY() + 7, [DETERMINATION DATE] <= TODAY() + 14), "Due 8-14 Days",
AND([DETERMINATION DATE] > TODAY() + 14, [DETERMINATION DATE] <= TODAY() + 21), "Due 15-21 Days",
[DETERMINATION DATE] >= TODAY() + 22, "Out for Consultation",
"Not Classified")
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Hello @hawkeye159 ,
Using Switch function will in power bi is more readable and easy to understand, I have re-written a dummy measure using switch instead of IF , kindly check if this works and try to replace this columns names in measure to your column names.
Testing Timeline =
SWITCH(
TRUE(),
[DETERMINATION DATE] < TODAY(), "Overdue",
AND([DETERMINATION DATE] >= TODAY(), [DETERMINATION DATE] <= TODAY() + 7), "Due in Next 7 Days",
AND([DETERMINATION DATE] > TODAY() + 7, [DETERMINATION DATE] <= TODAY() + 14), "Due 8-14 Days",
AND([DETERMINATION DATE] > TODAY() + 14, [DETERMINATION DATE] <= TODAY() + 21), "Due 15-21 Days",
[DETERMINATION DATE] >= TODAY() + 22, "Out for Consultation",
"Not Classified")
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Thank you so much! That's worked perfectly and I can see how it's been written. I had tried using the SWITCH function but am clearly struggling with how to set out the measure. Thanks again, it's really appreciated!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 78 | |
| 46 | |
| 37 | |
| 31 | |
| 26 |