Forum Discussion
Using selected value from one table in a calculation in another table
- Anonymous3 years ago
Hi Anonymous ,
Please try below steps:
1. below is my test table
Table1:
Table2:
Table2 = CALENDAR(DATE(2022,01,01),DATE(2023,2,6))2. create a measure with below dax formula
Measure = VAR min_date = MINX ( 'Table2', [Date] ) VAR max_date = MAXX ( 'Table2', [Date] ) VAR tmp = FILTER ( ALL ( Table1 ), [Start Date] >= min_date && [End Date] <= max_date ) RETURN SUMX ( tmp, [Sales] )3. add a slicer with Table2 field, add a card visual with measure
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.
Hi Anonymous ,
Please try below steps:
1. below is my test table
Table1:
Table2:
Table2 = CALENDAR(DATE(2022,01,01),DATE(2023,2,6))
2. create a measure with below dax formula
Measure =
VAR min_date =
MINX ( 'Table2', [Date] )
VAR max_date =
MAXX ( 'Table2', [Date] )
VAR tmp =
FILTER ( ALL ( Table1 ), [Start Date] >= min_date && [End Date] <= max_date )
RETURN
SUMX ( tmp, [Sales] )
3. add a slicer with Table2 field, add a card visual with measure
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.
- Anonymous3 years agoNot applicable
Thank you! That's what I was looking for.
I was a bit weird to me why max/min doesn't work (should've used maxx/minx) and the way of applying Filter() wasn't intuitive.