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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Multiple conditions that have to be true at the same time on same column from a Table

Hi All,

I have a table JobStatus, with PipelineId,Status.

PipelineIdStatus
1Build
1Unit Test
1Functional Test
1Scan Status
2Build
2Unit Test
2Functional Test
2Scan Status

I am trying to get diffrent levels based on the status for each pipelineid. PipelineId is not unique.

if (Status = "Build" && Status = "Unit Test" && Status = "Functional Test" && Status = "Scan Status" Then "Level 0)

Above statement is not working when I use && (and) condition.

Not sure how to add pipelineId as filter to the above statement.

Expected result is 

PipelineIdStatusLevels
1BuildLevel 0
1Unit TestLevel 0
1Functional TestLevel 0
1Scan StatusLevel 0
2BuildLevel1
2Unit TestLevel1
2Functional TestLevel1
2Scan StatusLevel1
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. In Power query. Add Column Index Column From 1.

vyangliumsft_0-1657785686520.png

2. Create calculated column.

Rank =
RANKX(
    FILTER(ALL('Table'),
    'Table'[PipelineId]=EARLIER('Table'[PipelineId])),[Index],,ASC)
Levels =
var _build=CALCULATE(MAX('Table'[Status]),FILTER(ALL('Table'),
'Table'[PipelineId]=EARLIER('Table'[PipelineId])&&'Table'[Index]=EARLIER('Table'[Index])))
return
"Levels"&" "&
IF(
   AND( 'Table'[Rank]=1 ,'Table'[Status]="Build") ||
   AND( 'Table'[Rank]=2 ,'Table'[Status]="Unit Test")||
AND( 'Table'[Rank]=3 ,'Table'[Status]="Functional Test")||
AND( 'Table'[Rank]=4 ,'Table'[Status]="Scan Status"),
'Table'[PipelineId]-1
)

2. Result:

vyangliumsft_1-1657785686523.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. In Power query. Add Column Index Column From 1.

vyangliumsft_0-1657785686520.png

2. Create calculated column.

Rank =
RANKX(
    FILTER(ALL('Table'),
    'Table'[PipelineId]=EARLIER('Table'[PipelineId])),[Index],,ASC)
Levels =
var _build=CALCULATE(MAX('Table'[Status]),FILTER(ALL('Table'),
'Table'[PipelineId]=EARLIER('Table'[PipelineId])&&'Table'[Index]=EARLIER('Table'[Index])))
return
"Levels"&" "&
IF(
   AND( 'Table'[Rank]=1 ,'Table'[Status]="Build") ||
   AND( 'Table'[Rank]=2 ,'Table'[Status]="Unit Test")||
AND( 'Table'[Rank]=3 ,'Table'[Status]="Functional Test")||
AND( 'Table'[Rank]=4 ,'Table'[Status]="Scan Status"),
'Table'[PipelineId]-1
)

2. Result:

vyangliumsft_1-1657785686523.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but based on how the expected outcome looks like, I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Picture2.png

 

Levels CC = 
"Level " & JobStatus[PipelineId]

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi Jihwan,

 

PipelineId are alphanumeric and your code did not worked. I have diffrent status for different pipelineids.

pipelineIds are nothing but URLs. We can not append the ids. I have given you just a sample to understand the requirement. Thank you

amitchandak
Super User
Super User

@Anonymous , Try a new column like

 

new column=
Var _cnt = calculate(distinctcount(Table[Status]), filter(Table, Table[PipelineID] = earlier(Table[PipelineID) && [Status] in {"Build" ,"Unit Test" , "Functional Test" , "Scan Status" }))
return
if(_cnt =4, "Level 0", "Level 1")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit,
I am getting only 2 status as Level 0 and Level1. I should get all the status based on the available status for pipelineids. Please see below new column changes and results 

BSwetha_0-1657545139701.png

 

Results


Status_Result.PNG

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors