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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JulienBds
New Member

Function that take into account several rows

Hello everyone, may I request your help for a small problem I have on my PBI:

 

To make it simple, there are two columns: one with the control ID, and one that says active or inactive.

But there can be multiple rows with the same control ID that shows different output (active & inactive) (example below): 

JulienBds_0-1663309625960.png

I would like to identify in the PBI which control  ID has only lines that says “inactive”: if it is the case I will give it the value 0, otherwise (if a control need ID has at least one line “active”) I will give it the value 1 in a new column.
This value will be add to all the lines of the control need ID (in the example It will be 1 for every lines of the new column, even when it says inactive).

 

I hope it is understandable, many thanks in advance for your help.

Best,

Julien

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

@JulienBds 

 

Here is the solution,

 

ribisht17_0-1663310503302.png

Solution = if(CALCULATE(min('Table'[Active]),ALLEXCEPT('Table','Table'[Control ID]))="Active",1,0)

 

Regards,

Ritesh

View solution in original post

2 REPLIES 2
ribisht17
Super User
Super User

@JulienBds 

 

Here is the solution,

 

ribisht17_0-1663310503302.png

Solution = if(CALCULATE(min('Table'[Active]),ALLEXCEPT('Table','Table'[Control ID]))="Active",1,0)

 

Regards,

Ritesh

It works indeed, many thanks ! 

Regards,

Julien

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.