Forum Discussion
Filter on table visual
- 9 months ago
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.
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!
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.