cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors