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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.


Follow on LinkedIn
@ 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.