Forum Discussion
Jan_Trummel
3 years agoHelper IV
Dynamic filter by slicer
Hello to the forum, I have a question. 1) My data I have the Orders and Calendar tables in Power BI Desktop. Both are linked by a 1-n relationship: In the Orders table I have the fo...
- 3 years ago
Jan_Trummel Try something below. Note, assumes disconnected tables for slicers. PBIX is attached below signature.
Measure = VAR __Date = MAX('Dates'[Date]) VAR __DaysBack = [Parameter Value] VAR __OrderDate = MAX('Orders'[Order date]) VAR __Result = IF(__OrderDate <= __Date && __OrderDate >= __Date - __DaysBack, SUM('Orders'[Sales]), BLANK()) RETURN __Result
Greg_Deckler
3 years agoCommunity Champion
Jan_Trummel Try something below. Note, assumes disconnected tables for slicers. PBIX is attached below signature.
Measure =
VAR __Date = MAX('Dates'[Date])
VAR __DaysBack = [Parameter Value]
VAR __OrderDate = MAX('Orders'[Order date])
VAR __Result = IF(__OrderDate <= __Date && __OrderDate >= __Date - __DaysBack, SUM('Orders'[Sales]), BLANK())
RETURN
__Result
- Jan_Trummel3 years agoHelper IV
Hi, Greg_Deckler do you think there is a solution where the Calendar table can stay connected to the Orders table?
This would be exactley what I need.