Forum Discussion
Cumulative Filter for previous values
- 2 years ago
exe_binary OK, one, I had an error in the measure:
Selector = VAR __Minutes = MAX('Table'[Minutes]) VAR __Value = MAX('Filter table'[Minute Filter]) VAR __MaxMinutes = SWITCH( __Value, "< 2 hrs", 120, "< 4 hrs", 240, "< 8 hrs", 480, "< 16 hrs", 960, "< 1 day", 1440, 1000000 ) VAR __Result = IF( __Minutes <= __MaxMinutes, 1, 0 ) RETURN __ResultSecond, did you add the measure to the Filters pane and filter for 1? I attached a PBIX file that shows the correct configuration. Below signature.
Greg_Deckler - sorry, maybe I did something wrong but it doesn't work for me.
So, I created a new table with just one column (disconnected table):
Then in my "Table1", I created a Selector per your instructions:
Selector =
VAR __Minutes = MAX('Table1'[Minutes])
VAR __Value = MAX('Filter table'[Minute Filter])
VAR __MaxMinutes =
SWITCH( TRUE(),
"< 2 hrs", 120,
"< 4 hrs", 240,
"< 8 hrs", 480,
"< 16 hrs", 960,
"< 1 day", 1440,
1000000
)
VAR __Result = IF( __Minutes <= __MaxMinutes, 1, 0 )
RETURN
__ResultNow, when I filter the table that I created from columns from Table1, nothing happens.
- Greg_Deckler2 years agoCommunity Champion
exe_binary OK, one, I had an error in the measure:
Selector = VAR __Minutes = MAX('Table'[Minutes]) VAR __Value = MAX('Filter table'[Minute Filter]) VAR __MaxMinutes = SWITCH( __Value, "< 2 hrs", 120, "< 4 hrs", 240, "< 8 hrs", 480, "< 16 hrs", 960, "< 1 day", 1440, 1000000 ) VAR __Result = IF( __Minutes <= __MaxMinutes, 1, 0 ) RETURN __ResultSecond, did you add the measure to the Filters pane and filter for 1? I attached a PBIX file that shows the correct configuration. Below signature.
- exe_binary2 years agoFrequent Visitor
Hey Greg_Deckler - I tested your PBI report and everything works fine except the value that are > 1440. Picture below.
I tried to modify the "Selector" but without success.Also, when I add "Selector" to my table, I get this error: