Forum Discussion
SergioTorrinha
2 years agoResolver II
Filtering Wide Aggregation Table - How to ?
Hi everyone! I have been working with PBI, practically since the start in 2015, and at this point I'm quite used to build my reports based on a star schema data model, because I know very well th...
Sahir_Maharaj
2 years agoSuper User
Hello SergioTorrinha,
Here's a conceptual example to apply dynamic filtering that responds to the selection.
Dynamic Filter Measure =
VAR SelectedField = SELECTEDVALUE(FieldSelectionTable[FieldName], "decimal_field_1")
VAR FilterValue = 100 // This could be dynamically set through another mechanism, like a parameter
RETURN
SWITCH(
SelectedField,
"decimal_field_1", CALCULATE(SUM(Table[decimal_field_1]), Table[decimal_field_1] > FilterValue),
"decimal_field_2", CALCULATE(SUM(Table[decimal_field_2]), Table[decimal_field_2] > FilterValue),
...
"decimal_field_50", CALCULATE(SUM(Table[decimal_field_50]), Table[decimal_field_50] > FilterValue),
BLANK()
)
Just a note - Performance might be impacted with very wide tables and complex dynamic measures, especially on large datasets.