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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GuidoPinares
Helper I
Helper I

Mesure to count repetitions

Hi Community!

 

I have been practicing and feel stucked in this part, if someone could give me some guide i will be grateful.

 

I have the next example table:

 

GuidoPinares_0-1658263029928.png

 

I would like to transfer this logic to Power BI. I have a column name, an activity and a group. I want to know if a Person has "any group" and also the group "Others", for example if the person is on Wheels and Balls group it counts as False, is True just when is in any group and also in Others.

 

My mind is blowing, i will appreciate any help!

 

Thanks in advance.

1 ACCEPTED SOLUTION

Thanks for the help!!

At the beggining it doesnt work because i think it was taking the last record boolean, so i add this line and it works.

ALLEXCEPT('Table','Table'[Name])
 
So the code finally is this way:

Control =
VAR other = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] = "Others", ALLEXCEPT('Table','Table'[Name])) > 0
VAR some_group = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] <> "Others", ALLEXCEPT('Table','Table'[Name])) > 0
RETURN
AND(other;some_group)
 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Count of activites and group = CALCULATE(COUNTROWS(Data),ALLEXCEPT(Data,Data[name]))
Count of Other group = CALCULATE(COUNTROWS(Data),ALL(Data[Activity]),Data[Group]="Others")
Control = if(max(Data[Group])="Others","-",[Count of activites and group]<>1)

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PAG
Frequent Visitor

Hi ! 

 

I think you can do this as a new column

 

Control =
VAR other = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] = "Others") > 0
VAR some_group = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] <> "Others") > 0
RETURN
AND(other;some_group)
 
Cheers
PAG

Thanks for the help!!

At the beggining it doesnt work because i think it was taking the last record boolean, so i add this line and it works.

ALLEXCEPT('Table','Table'[Name])
 
So the code finally is this way:

Control =
VAR other = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] = "Others", ALLEXCEPT('Table','Table'[Name])) > 0
VAR some_group = CALCULATE(COUNTROWS('Table');
                'Table'[Name] = EARLIER('Table'[Name]) &&
                'Table'[Group] <> "Others", ALLEXCEPT('Table','Table'[Name])) > 0
RETURN
AND(other;some_group)
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.