Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.