Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

power bi visual - can I select rows by min (value) for a variable in a group

Hi

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_idgroup_1vargroup_2
1A1.1X
2A1.2Y
3A0.9Z
4B0.5X
5B0.7Z
6C1X
7D2X
 
 For my visual I want to use rows: row_id =3,ow_id =4,ow_id =6, ow_id =7,

In R language I can do it with

dataset<-dataset %>%group_by(group_1)%>%dplyr::slice(which.min(var))
Is possible use   this concept  in powerbi visual?
 
Thanks
25 REPLIES 25
Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Syndicate_Admin
Administrator
Administrator

Hello, @pedrof

Depending on your description, I created data to reproduce your scenario. The pbix file is attached at the end.

mesa:

c1.png

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.

c2.png

Best regards

Allan

If this post helps, consider ACCEPT as the solution to help other members find it faster.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.