Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to use an if statement that uses a "fake" date when an order haven't been assigned a arrival date.
But when writing this seemingly easy piece of code I get the below error message saying that it "can't return a variant data typ..."
There has to be a way around this. Does anyone know?
Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous
try using DATE(2999,12,31) in the second argument of IF() statement in place of "2999-12-31"
Thanks for both answers!
However I've tried that before and yes, the code works. But then I instead face the problem that Arival-date has the wrong data type. The end result is a column where I can change the type to Date (so that I can use a Date interval as a slicer).
"2999-12-31" is a string, not a real date. Use the DATE function.
Hi @Anonymous
try using DATE(2999,12,31) in the second argument of IF() statement in place of "2999-12-31"
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |