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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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