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
Anonymous
Not applicable

Grouping of data 1

I have a table with user details:

IDActivity ID
1233
1237
3457
8991
1001
3457
3457

I want above table to be grouped based on ID = 7. Something like below

Count of ID with no Activity ID = 72
Count of ID with 1 Activity ID = 71
Count of ID with 2 Activity ID = 70
Count of ID with activity ID= 7 is >= 31
1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hey, @prinkujose

Depending on your description, you can try these measures:

Count of ID with no Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=BLANK()),[ID])

return IF(_count=BLANK(),0,_count)

Count of ID with 1 Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=1),[ID])

return IF(_count=BLANK(),0,_count)

Count of ID with 2 Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=2),[ID])

return IF(_count=BLANK(),0,_count)
Count of ID with 3 or more Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]>=3),[ID])

return IF(_count=BLANK(),0,_count)

And you can get whatever you want, like this:

v-robertq-msft_0-1605081733754.png

You can download my test pbix file here

Best regards

Qin Community Support _Robert Team

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

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hey, @prinkujose

Depending on your description, you can try these measures:

Count of ID with no Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=BLANK()),[ID])

return IF(_count=BLANK(),0,_count)

Count of ID with 1 Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=1),[ID])

return IF(_count=BLANK(),0,_count)

Count of ID with 2 Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]=2),[ID])

return IF(_count=BLANK(),0,_count)
Count of ID with 3 or more Activity ID is 7 =

var _Table =

SUMMARIZE(

'Table',

[ID],

"Count",

COUNTX(FILTER('Table',[Activity ID]=7),[ID]))

var _count= COUNTX(FILTER(_Table,[Count]>=3),[ID])

return IF(_count=BLANK(),0,_count)

And you can get whatever you want, like this:

v-robertq-msft_0-1605081733754.png

You can download my test pbix file here

Best regards

Qin Community Support _Robert Team

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

Anonymous
Not applicable

What is your detail requirement, it's not clear to be honest. Thanks!

Anonymous
Not applicable

I would like to group table 1 based on activity ID 7. If you notice, ID with no actvity ID - 7 is 2 ie 899 and 100

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.