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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am trying to create a calculated column that Counts the age of a customer in Days IF the time the customer was created was THIS YEAR.
I've come up with multiple IF statements but nothing has worked properly.
This is part of what I've got:
To calculate the age (in days) - AGE=DATEDIFF(Customer[CustomerTimeCreated],TODAY(), DAY).
What I need to do is create an IF statement:
AGE OF CURRENT YEAR CUSTOMERS = IF(YEAR(Customer[CustomerTimeCreated])= "Current Year", DATEDIFF(Customer[CustomerTimeCreated],TODAY(), DAY), "Previous Year Customer")
Any ideas on the best way to do this?
Solved! Go to Solution.
Figured it out!! 😄 Code is included in screenshot. 🙂
@heathernicole Great Job once again!
Yes you can't have a conditional statement produce a number if true and text if false.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 39 | |
| 33 | |
| 25 |