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
NilR
Post Patron
Post Patron

How to Group by filter ONLY VALUES SUM(MBR_MOS) Greater than 0

Hi,

 

In my below group by how I can add filter that if the sum or MBR_MOS column is not 1 or more then do not include.

 

 

 

VAR _CNSR_ID = GROUPBY(FILTER('tbl', [GP]=_gp && [Date] >= 022022 && [Date] <= 032022 && MAX('tbl'[MALES_UNDER_35]) = "Yes" && MAX('tbl'[last_22_months]) >= 22), [CNSR_ID] )

 

 

 

I tried  MAX([MBR_MOS]) >0 and SUM([MBR_MOS]) >0  in the filter section which they don't work. I need this group by for my measure. 

 

GPCNSR_IDDATE    MBR_MOS
3214446202202  0
3214446202201  1
3214446202112  1
1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @NilR ,

Please try below steps:

1. my test table

Table:

vbinbinyumsft_0-1661148647090.png

2. create a  measure and add it to table visual

Measure =
VAR tmp =
    SUMMARIZE ( 'Table', 'Table'[ID], "Sum for Count", SUM ( 'Table'[Count] ) )
VAR tmp1 =
    FILTER ( tmp, [Sum for Count] > 0 )
RETURN
    CALCULATE ( SUM ( 'Table'[Count] ), tmp1 )

vbinbinyumsft_2-1661148816919.png

Please refer my attached .pbix file

 

Best regards,
Community Support Team_ Binbin Yu
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-binbinyu-msft
Community Support
Community Support

Hi @NilR ,

Please try below steps:

1. my test table

Table:

vbinbinyumsft_0-1661148647090.png

2. create a  measure and add it to table visual

Measure =
VAR tmp =
    SUMMARIZE ( 'Table', 'Table'[ID], "Sum for Count", SUM ( 'Table'[Count] ) )
VAR tmp1 =
    FILTER ( tmp, [Sum for Count] > 0 )
RETURN
    CALCULATE ( SUM ( 'Table'[Count] ), tmp1 )

vbinbinyumsft_2-1661148816919.png

Please refer my attached .pbix file

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

You need to apply that filter separately, on the outside of the GROUPBY. It will be better to use SUMMARIZE so you can add the aggregations to the groups.

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 Solution Authors