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 Use a disconnected table for your <2, <4, <8 values. You can then create a Complex Selector measure like this:
Selector =
VAR __Minutes = MAX('Table'[Minutes])
VAR __Value = MAX('Disconnected Table'[Value])
VAR __MaxMinutes =
SWITCH( TRUE(),
"<2", 120,
"<4", 240,
"<8", 480,
"<16", 960,
"<1 day", 1440,
1000000
)
VAR __Result = IF( __Minutes <= __MaxMinutes, 1, 0 )
RETURN
__Result