cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Diego-mx
Advocate I
Advocate I

columnized isblank() for IF definition in DAX

This seems very simple, but I'm getting errors.  

I want to replace a blank values in a date column with today. 

That is to have a calculated column as:   

no_blanks = IF( ISBLANK( a_table[a_date])
  , today()
  , a_table[a_date]) 


But then I get the error that: 

Spoiler
A single value for colum 'a_date' in table 'a_table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as ... 


Thank you.  

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Diego-mx,

 

Actually, if you use the formula as a calculated column, that should be right. I also made a test with your formula, everything works as expected.

 

Please check if you do create the calculated column with the formula?

 

In addition, if you still have this error, could you share a dummy pbix file which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Diego-mx,

 

Actually, if you use the formula as a calculated column, that should be right. I also made a test with your formula, everything works as expected.

 

Please check if you do create the calculated column with the formula?

 

In addition, if you still have this error, could you share a dummy pbix file which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you for your help. 
I turned out I was doing a calculated column on a wrong table, and therefore got that error.  
I still dont know how it came to that, but I'm glad to know It works, and next time I'll bug with more interesting stuff. 

Cheers.

Hi @Diego-mx,

 

I'm glad that you have solved your issue. Only thing that you'll have to notice, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

If you are doing that as a measure, then you need to wrap your column references with an aggregator like MAX. Or, use the formula you have in a calculated column.


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.