Forum Discussion
exe_binary
2 years agoFrequent Visitor
Cumulative Filter for previous values
Hello folks, I am newbiew in Power BI, and now I am struggiling to create a formula for filtering. This would be my data set example: Country Mark Minutes AA aa11 30 AA aa22 60 ...
- 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
2 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
__Result
Second, 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_binary
2 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: