Forum Discussion
Summary table utilizing dynamic dates from slicer
- 1 year ago
Hi Anonymous
I've solved this by creating a DAX table using GENERATESERIES() to generate 10 rows representing the last 10 years. I cross-joined this table with one of my existing tables and added calculated columns derived from other tables. This gives me a row of data for each building for each year, allowing me to filter by year. Since there are only a couple of hundred buildings, it works well, but I might need to limit the number of years for performance reasons.
Hello Samand,
Can you please try this consolidated DAX for a calculated table:
SummaryTable =
SUMMARIZE(
'fact_Building',
'fact_Building'[Building_Type],
"Total Rows AcqDisp",
CALCULATE(
COUNTROWS('fact_AcqDisp'),
'fact_AcqDisp'[FROM] <= MAX('dim_Dates'[Date]) &&
'fact_AcqDisp'[TO] >= MIN('dim_Dates'[Date])
),
"Total Rows Building",
CALCULATE(
COUNTROWS('fact_Building'),
'fact_AcqDisp'[FROM] <= MAX('dim_Dates'[Date]) &&
'fact_AcqDisp'[TO] >= MIN('dim_Dates'[Date])
),
"Total Measurements",
CALCULATE(
SUM('fact_Measurements'[Measurement_Value]),
'fact_Measurements'[FROM] <= MAX('dim_Dates'[Date]) &&
'fact_Measurements'[TO] >= MIN('dim_Dates'[Date])
)
)
- Samand1 year agoFrequent Visitor
Thanks for your response.This doesn't work. I Think it's because DAX tables don't recalculate based on slicers. When referencing dim_Dates it uses all of the dates. I think only measures recalculate based on slicer selections.