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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.