Forum Discussion

TcT85's avatar
TcT85
Helper III
9 months ago
Solved

Filter on table visual

Hi,

 

 

 

I'm using two table visuals (not database tables):

  • Table 1 displays data from all our test equipment for today.
  • Table 2 shows data from the last 30 days.

What I want is: when I click on a row in Table 1, I’d like Table 2 to filter and show only the historical data for the same equipment and product—for example, Equipment "Test1" and Product "1111"—over the past 30 days.

However, currently when I click a row in Table 1, Table 2 only filters to a single day, instead of showing the full 30-day history for that equipment and product.

----------------------------------------------------------------------------------------------------------------------------------------------

Sorry for not being thourough enough. I will try to clarify my message.

 

Here is the database table

DateEquipmentProductYieldPass

Fail

2025-11-01Test11111100%100
2025-11-02Test1111150%55
2025-11-03Test11111100%100
2025-11-04Test1111150%55
2025-11-06Test11111100%100
2025-11-01Test2222250%55
2025-11-01Test33333100%100
2025-11-01Test3444450%55
2025-11-02Test35555100%100

 

 

This is table visualisation for today:

With this filter.

 

 

This is table visualisation for the last 30 days:

With this filter.

 

If I click on this row on table 1:

 

I want all of these rows to be shown for table 2 that is related with the equipment and product.

 

Now I only get the same row in table2 as table 1 when i click on that row.

 

  • Hi TcT85
    Thanks for the follow-up question.

    I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.

    outcome: 

    I am also including .pbix file for your better understanding, please have a look into it.

    Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

    Thank you for using the Microsoft Fabric Community Forum.

12 Replies

  • PijushRoy's avatar
    PijushRoy
    Community Champion

    Hi TcT85 

     

    Please create a sample PBIX file and share the PBIX file link (google drive/onedrive etc) 

  • Hi TcT85,

     

    Try to remove date filter from table 2 and apply filter context from table 1, for e.g. product.

     

    Try below query 

     

    ShowInLast30Days =
    VAR SelectedEquipment = SELECTEDVALUE('TodayData'[Equipment])
    VAR SelectedProduct = SELECTEDVALUE('TodayData'[Product])
    VAR MaxDate = MAX('AllData'[Date])
    VAR Last30Days =
    DATESINPERIOD('AllData'[Date], MaxDate, -30, DAY)

    RETURN
    CALCULATE(
    [YourMeasure], -- e.g., SUM(AllData[Yield]) or COUNTROWS(AllData)
    FILTER(
    ALL('AllData'),
    'AllData'[Equipment] = SelectedEquipment &&
    'AllData'[Product] = SelectedProduct &&
    'AllData'[Date] IN Last30Days
    )
    )

    If required you can remove the Date filter from table 2, add removefilters function.

     

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    🔗 Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

    • TcT85's avatar
      TcT85
      Helper III

      Hi grazitti_sapna ,

      I can't get it to work. I added this measure to table 2 and removed date filter from table 2. I have edited my message for better clarification.

  • Create this measure in your data model:

     
    Yield_Filtered_30Days = CALCULATE( SUM(YourTable[Yield]), -- Or your original measure ALLEXCEPT( YourTable, YourTable[Equipment], YourTable[Product] ) )

    Why this works:

    • Keeps filter context on Equipment and Product.

    • Removes any filter on Date, so Table 2 continues to show 30-day history.

    • No changes needed to relationships or visuals.

    How to use:

    • Use this measure Yield_Filtered_30Days in Table 2 instead of original Yield.

    • Clicking a row in Table 1 applies filters only on Equipment and Product.

    • TcT85's avatar
      TcT85
      Helper III

      Hi Shubham_rai955 

      I have tried your measure but I cant get it to work, maybe I have explained my issue to vague, I have updated my message above for better clarification, sorry for the inconvience.

  • Hi TcT85 ,

    the information is bit in complete.but i will try to share the steps.

    1. Create a measure for rowcount or count which will take common column or dimension between 2 tables
    2. then select table 2 and add measure created in step 1 to visual level filter
    3. add condition measure is greater than 0 in visual level filter

    Please find sample pbix file for reference.Sampl PBIX 

     

    Give kudos or mark it as solution once confirmed.

     

    Thanks and Regards,

    Praful

  • Hi TcT85,

    Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to Praful_Potphode, Shubham_rai955, grazitti_sapna, PijushRoy, for those inputs on this thread.

    I reproduced the scenario, and it worked on my end. I used it as sample data and successfully implemented it.

    Sample data: 


    Dax Measures: 

    Yield Today: 

    Yield Today = 
    DIVIDE([Pass Today], [Pass Today] + [Fail Today])


    Pass Today: 

    Pass Today = 
    CALCULATE(
        SUM(Data[Pass]),
        Data[Date] = DATE(2025,11,6)
    )


    Fail Today: 

    Fail Today = 
    CALCULATE(
        SUM(Data[Fail]),
        Data[Date] = DATE(2025,11,6)
    )

     

    outcome:

     

    I am also including .pbix file for your better understanding, please have a look into it.

    Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

    Thank you for using the Microsoft Fabric Community Forum.

    • TcT85's avatar
      TcT85
      Helper III

      hi v-kpoloju-msft 

      I got to it work with the fictional datatable i shared with you, but when i try with my real data it''s not working.

      Is it because the data is in this order ?

      EquipmentProductSerialNumberStatusDate 
      Test111110001Pass2025-11-07 
      Test111110001Fail2025-11-06 
      Test111110002Pass2025-11-06 
      Test122220003Pass2025-11-06 
      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Community Support

        Hi TcT85
        Thanks for the follow-up question.

        I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.

        outcome: 

        I am also including .pbix file for your better understanding, please have a look into it.

        Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

        Thank you for using the Microsoft Fabric Community Forum.