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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Michael_Shown
New Member

How to do 'group by' in power BI report

Hi,

 

I'm new to Power BI.

I have a very simple data set as below and I want end user(s) to group any column(s) from a single table.

Group By functionality is available in power query editor but I'm wondering if there's any way of grouping rows by a column in power bi report publishsed to power bi service.

Any comment will be very appreiciated.

 Custom grouping in power BI.JPG

 

Thank you.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Michael_Shown ,

 

Here are the steps you can follow:

1. Create measure.

Measure = 
    IF(
        ISINSCOPE('Table'[Item number]),
        
      MAX('Table'[Color])
        ,
        IF(
    ISINSCOPE('Table'[Color]),
      COUNTX(
            FILTER(ALL('Table'),'Table'[Color]=MAX('Table'[Color])),[Item number])
    ,
    COUNTX(ALL('Table'),'Table'[Color])))

2. Result:

vyangliumsft_0-1690350154015.png

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Michael_Shown ,

 

Here are the steps you can follow:

1. Create measure.

Measure = 
    IF(
        ISINSCOPE('Table'[Item number]),
        
      MAX('Table'[Color])
        ,
        IF(
    ISINSCOPE('Table'[Color]),
      COUNTX(
            FILTER(ALL('Table'),'Table'[Color]=MAX('Table'[Color])),[Item number])
    ,
    COUNTX(ALL('Table'),'Table'[Color])))

2. Result:

vyangliumsft_0-1690350154015.png

Best Regards,

Liu Yang

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

AnkitKukreja
Super User
Super User

Hi @Michael_Shown 

 

Does this work for you?  If yes, just right click on your column from the table and use option create hierarchy.

 

AnkitKukreja_0-1690208864818.png

AnkitKukreja_1-1690208940431.png

 

 

attaching the pbix file for your reference.

 

 

If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.
Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors