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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
stacey
Frequent Visitor

Filter with empty rows

Hi PBI Community,

 

I'm new in Power BI and I'm struggling with a table.

It's a bit complex (for me :P) and I'd really appreaciate any guidance or help.

 

I have the table below. I want to keep the topics that are in a specific date period and the topics that are empty.

stacey_3-1692825224427.png

 

 

I need to:

- keep the topics that are between "2weeks before today and 2weeks after today"

- keep the topics that are empty i.e have no next milestone (like topic B)

- if topics include both empty fields and text fields, then keep only the text fields.

 

The end result should look like this:

 

stacey_6-1692826321649.png

 

My first thought was to calculate the difference between today-next date and limit the period with a slicer. That gives me the below result, but how can I remove the empty row from Topic A?

 

Diff Today-NextDate = DATEDIFF(TODAY(),'Table'[Next Date],DAY)

stacey_7-1692826363511.png

Any ideas?

 

Thanks

10 REPLIES 10
parry2k
Super User
Super User

@stacey I think where the issue, can you describe the logic why you are getting C and D in your result set (on your original post)

 

- keep the topics that are between "2weeks before today and 2weeks after today"

- keep the topics that are empty i.e have no next milestone (like topic B)

- if topics include both empty fields and text fields, then keep only the text fields.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi,
C and D don't include next key milestones dates between the requested timeline  "2weeks before today and 2weeks after today".

The idea is to still show these topics even if they don't include the milestones.

 

Thanks

danextian
Super User
Super User

Hi @stacey ,

I am thinking those actually arent blank cells. But try this:

=
IF (
    ISBLANK ( 'table'[NextMileStone] )
        || 'table'[NextMileStone] = "",
    BLANK (),
    DATEDIFF ( TODAY (), 'Table'[Next Date], DAY )
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks for the reply.
It gives the same result.

stacey_0-1692828247284.png

 

What does the calculated column show in data view? Please also show those colums in Power Query.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

stacey_0-1692857709291.png

 

Those blank lines probably aren't null. Power Query would show if they are. If they arent null, I'd replace them by right clicking on an empty cell, click replace value, leave the value to replace as is and enter null in as the new value.  I'd do that for all columns. Alternatively and assuming that the blank cells don't have any length, you can modify your formula to this:

=
IF (
    LEN ( 'table'[NextMileStone] ) < 1,
    BLANK (),
    DATEDIFF ( TODAY (), 'Table'[Next Date], DAY )
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks for the reply. Unfortunately it doesn't work. 
I'll try  to find some other workaround.

You still have not posted a screenshot of your data in power query





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

stacey_0-1693327840199.png

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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