I'm new in powerbi. My question is: Can I select (filter) rows in powerbi visual, by min(value) from a variable in a group? For example I have a dataset:
| row_id | group_1 | var | group_2 |
| 1 | A | 1.1 | X |
| 2 | A | 1.2 | Y |
| 3 | A | 0.9 | Z |
| 4 | B | 0.5 | X |
| 5 | B | 0.7 | Z |
| 6 | C | 1 | X |
| 7 | D | 2 | X |
I'm new in powerbi. My question is: Can I select (filter) rows in powerbi visual, by min(value) from a variable in a group? For example I have a dataset:
| row_id | group_1 | var | group_2 |
| 1 | A | 1.1 | X |
| 2 | A | 1.2 | Y |
| 3 | A | 0.9 | Z |
| 4 | B | 0.5 | X |
| 5 | B | 0.7 | Z |
| 6 | C | 1 | X |
| 7 | D | 2 | X |
In R language I can do it with
dataset<-dataset %>%group_by(group_1)%>%dplyr::slice(which.min(var))
Enable the advanced filter options ("allow users to change filter type") for your report users and then use the filter pane to pick the rows of interest in a variety of different ways.
Hi, Anonymous
Based on your description, i created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
Then you need to put the measure in the visual level filter to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.
Hello, @pedrof
Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.
mesa:
You can create a measure as follows.
Visual Control =
var _min =
CALCULATE(
MIN('Table'[var]),
ALLEXCEPT('Table','Table'[group_1])
)
return
IF(
SUM('Table'[var])=_min,
1,0
)
You must then place the measure in the visual level filter to filter the result.
Best regards
Allan
If this post helps, consider ACCEPT as the solution to help other members find it faster.