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
benjiboy007
Frequent Visitor

How to filter on defined groups?

Hi all!,

 

I have the following topic: I have 3 different groups :

Group A= code 1,2,3,4

Group B = code 2,3,4

Group C = code 3 ,4

benjiboy007_1-1704914938465.png

 

Now I would like to establish 1 single filter with Group A, Group B and Group C  to sort the data and calculate the amounts correctly.  So far I managed to create 3 separate filters for the 3 Groups  (but this is not ideal)

I suppose the solution should come from a Parameter function

Does anyone have a hint here?

 

 

 

Many thanks!!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @benjiboy007 

You can refer to the following sample

Sample data 

vxinruzhumsft_1-1704953420062.png

Set the group as a table, and put the group column to the slicer.

vxinruzhumsft_0-1704953358837.png

Then create a measure

Measure =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER (
        'Table',
        [Code] >= MIN ( 'Group'[MinCode] )
            && [Code] <= MAX ( 'Group'[MaxCode] )
    )
)

Output

vxinruzhumsft_2-1704953547413.png

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @benjiboy007 

You can refer to the following sample

Sample data 

vxinruzhumsft_1-1704953420062.png

Set the group as a table, and put the group column to the slicer.

vxinruzhumsft_0-1704953358837.png

Then create a measure

Measure =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER (
        'Table',
        [Code] >= MIN ( 'Group'[MinCode] )
            && [Code] <= MAX ( 'Group'[MaxCode] )
    )
)

Output

vxinruzhumsft_2-1704953547413.png

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That's great, many thanks!

Idrissshatila
Super User
Super User

Hello @benjiboy007 ,

 

you mean like using field parameters , check it out https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hello, thanks for your reply

 

I would like to avoid the entry of the Parameter in my visual (as my visual in my PBI are already completely stuffed with dates on x-axis). In screensshot below I filter the visual with 3 different filters. I'm  looking for a solution in which I only have 1 filter

 

benjiboy007_1-1704916974892.png

 

 

 

HEllo @benjiboy007 .

 

put all three columns in one slicer. try it



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




This gives the below results. Unfortunately the 'blanks' ruin it here. 

 

benjiboy007_1-1704917670234.png

 

 

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!

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.

Top Solution Authors
Top Kudoed Authors