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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Susan12344
Regular Visitor

Filter on empty rows

Hi Power BI community!

 

I hope someone can point me in the right direction on this. My situation is as following:

 

I have two tables with product names. One of them is a table with all the available products and the other is the actual bought products by customers.

I want to show within a certain time frame which products were not bought by customers. So basically text values that are available in table 1 but not in table 2. I'm a bit stuck on which filter to use and I'm not googleing the right question. Can anyone point me in the right direction? Much appreciated!!

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @Susan12344 ,

Please try below steps:

1. below is my test table

Table1:

vbinbinyumsft_0-1670550925995.png

Table2:

vbinbinyumsft_1-1670550941876.png

Table3:

create with below dax formula

Table3 = CALENDAR(FIRSTDATE(Table2[Date]),LASTDATE(Table2[Date]))

vbinbinyumsft_2-1670550959572.png

2. below is the model

vbinbinyumsft_3-1670551043107.png

3. create a measure with below dax formula

Measure =
VAR min_date =
    MIN ( Table3[Date] )
VAR max_date =
    MAX ( Table3[Date] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( Table2[Product] ),
        Table2[Date] >= min_date,
        Table2[Date] <= max_date
    )
VAR cur_pt =
    SELECTEDVALUE ( Table1[Product] )
RETURN
    IF ( cur_pt IN tmp, 0, 1 )

3. add a slicer with Table3[Date], add two table visual with Table1 field and Table2 fields, add measure to a table visual filter pane that created with Table1 field

vbinbinyumsft_4-1670551220727.png

4. below is output

Animation23.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

1 REPLY 1
v-binbinyu-msft
Community Support
Community Support

Hi @Susan12344 ,

Please try below steps:

1. below is my test table

Table1:

vbinbinyumsft_0-1670550925995.png

Table2:

vbinbinyumsft_1-1670550941876.png

Table3:

create with below dax formula

Table3 = CALENDAR(FIRSTDATE(Table2[Date]),LASTDATE(Table2[Date]))

vbinbinyumsft_2-1670550959572.png

2. below is the model

vbinbinyumsft_3-1670551043107.png

3. create a measure with below dax formula

Measure =
VAR min_date =
    MIN ( Table3[Date] )
VAR max_date =
    MAX ( Table3[Date] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( Table2[Product] ),
        Table2[Date] >= min_date,
        Table2[Date] <= max_date
    )
VAR cur_pt =
    SELECTEDVALUE ( Table1[Product] )
RETURN
    IF ( cur_pt IN tmp, 0, 1 )

3. add a slicer with Table3[Date], add two table visual with Table1 field and Table2 fields, add measure to a table visual filter pane that created with Table1 field

vbinbinyumsft_4-1670551220727.png

4. below is output

Animation23.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors