Forum Discussion
Check if column value is null or blank in DAX
I have the sample DAX query above. Is there away i can manipulate 'Target_FormResponse'[Area Used] such that if it is blank or empty, i return "No" otherwise if its not blank or empty i return "Yes".
In SSRS, i can do something like =IIF(Len(Fields!Form_Response.Value) > 0,"Yes","No") but i want to achieve this at the DAX query level.
On a different but related note, is there also away i can get only the time part (exclude the date) from an SSAS datetime column in the sample DAX query above?
Hi kadingo ,
We can use the following DAX to meet your requirement:
Table = ADDCOLUMNS ( FILTER ( SUMMARIZE ( NATURALLEFTOUTERJOIN ( 'Target_Category', 'Target_Form' ), 'Target'[Area], 'Target'[id], 'Target'[Target date], 'Target'[Target Time Rage], 'Target_Category'[Origin], 'Target_Category'[Sectotion], 'Target'[Location], 'Target_Category'[Ethencity], 'Target_FormResponse'[Area Used], 'Target'[Description] ), 'Target'[id] = 111373268 ), "Area Used Column", IF ( ISBLANK ( [Area Used] ), "No", "Yes" ) )We can try to use the Time Value function to get the time part of a Date/Time column
Time = TimeValue([Date])
Best regards,
2 Replies
- amitchandak
Super User
Try
IF(not(isblank(Target_FormResponse'[Area Used])),"Yes","No")Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin - v-lid-msft
Community Support
Hi kadingo ,
We can use the following DAX to meet your requirement:
Table = ADDCOLUMNS ( FILTER ( SUMMARIZE ( NATURALLEFTOUTERJOIN ( 'Target_Category', 'Target_Form' ), 'Target'[Area], 'Target'[id], 'Target'[Target date], 'Target'[Target Time Rage], 'Target_Category'[Origin], 'Target_Category'[Sectotion], 'Target'[Location], 'Target_Category'[Ethencity], 'Target_FormResponse'[Area Used], 'Target'[Description] ), 'Target'[id] = 111373268 ), "Area Used Column", IF ( ISBLANK ( [Area Used] ), "No", "Yes" ) )We can try to use the Time Value function to get the time part of a Date/Time column
Time = TimeValue([Date])
Best regards,