Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hello all,
I have a table with three columns: Seniority date, Hire date and data date.
I'd like to calculate the days/years between Seniority date and data date, however, the Seniority date column contains blanks and nulls along with actual dates.
If a given line contains either a blank or null for seniority date, then I want to look at Hire date and apply the same logic. If Hire date contains a blank or null, then return a blank in the field for SenYrs.
The below attempt at the code says there are no syntax errors but I get an error at runtime stating "The name 'isblank' wasn't recognized'. Any help or ideas would be appreciated.
if(not(isblank[Seniority Date])) or
[Seniority Date]<>null then
([data date]-[Seniority Date])/365.25
else
if(not(isblank[Hire Date])) or
[Hire Date]<>null then
([data date]-[Hire Date])/365.25
else
blank()
Appreciate the response, however, I still get the same error. I did try to rewrite the code but now am getting a "Token Then expected" error ar runtime:
if [Seniority Date] <> null || [Seniority Date] <> ""
then
([data date]-[Seniority Date])/365.25
else if [Hire Date] <> null || [Hire Date] <> ""
then
([data date]-[Hire Date])/365.25
else
blank()
your missing a bracket
if(not(isblank ( [Seniority Date])) or
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |