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
rocky_puff
Frequent Visitor

Validating date row, cannot determine what to compare for missing date row - using IF

Hi. Currently I have a task where I need to validate - if a Shop declared its status that day, so a Date row will created in the dataset. When I want to make a summary whether the Shop had declared or not on that month, I will validate the date row and if it exist, a table of declaration will be produced - containing a 'Yes' (declared) or 'No' (does not declare). I validated the Date row with a Master Date table.

 

But the issue here now is, when a Shop did not declare, and when I validate, my code(or power bi, not sure what's wrong) DOES NOT declare the missing Date as 'No'. I know whats wrong here, but I cannot figure out the solution. Due to non existent row in the dataset, power bi does not have anything to compare and validate with, thus leaving it blank instead of 'No'. Adding manually the date on the dataset, is not a very good idea for future sustainability.

 

Does anyone has any idea how to solve this issue efficiently?

 

Need your help, Thank you!

 

For example here, Shop F04 did not declare their status on 27/2/2021 and 28/2/2021. There is no "No" value in the table. Here I attached together my proposed formula. 

 

rocky_puff_0-1616632337758.png

rocky_puff_1-1616633163369.pngrocky_puff_2-1616633410494.png

 

 

1 ACCEPTED SOLUTION
rocky_puff
Frequent Visitor

I have found the solution. Maybe I overthink too much. So here is the solution that I used for my problem (eventhough im not sure how it works, but it works!) 🙂

 

Declaration = IF(MAX(February2021[Date]) == BLANK(), "No", "Yes")

 

It will then produce the outcome that I want ! Thanks everyone, I hope it helps you too 🙂

 

rocky_puff_0-1617240831859.png

 

View solution in original post

3 REPLIES 3
rocky_puff
Frequent Visitor

I have found the solution. Maybe I overthink too much. So here is the solution that I used for my problem (eventhough im not sure how it works, but it works!) 🙂

 

Declaration = IF(MAX(February2021[Date]) == BLANK(), "No", "Yes")

 

It will then produce the outcome that I want ! Thanks everyone, I hope it helps you too 🙂

 

rocky_puff_0-1617240831859.png

 

amitchandak
Super User
Super User

@rocky_puff , Not clear on the need of this column.

 

you can create a measure

measure = if(countrows(Table)+0=0,"No", "Yes")

 

Jan , feb should be filter from UI on the visual

I've tried the measure you proposed. But still can't get the "No".

 

rocky_puff_0-1616655059676.png

 

The Comparison Column is to show the result after validating whether the date exist or not (in other word, to validate whether the shop did or did not declare their status on that day)

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.

Top Solution Authors