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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Conditional variables

Hi everyone, 

 

I ran into a problem and I am not sure how to fix it in PowerBI. Here's the context:

 

Every employee in companyA is offered an educational course in Dutch and English, the employee picks the preferred language of choice and completes the course. However, when an employee picks the English course they, of course, don't need to fulfil the exact same course in another language. But because the course was still offered, the course shows up as expired. These double values contaminate the final dashboards. 

 

 Course1 code EnglishCourse1 statusCourse1 code DutchCourse1 status
John R4 EN ID:C1CompletedR4 NL ID:C1Expired
MichaelR4 EN ID:C1ExpiredR4 NL ID:C1Completed
AnneR4 EN ID:C1ExpiredR4 NL ID:C1Completed
RoseR4 EN ID:C1ExpiredR4 NL ID:C1Expired

 

 

Is there any way to mitigate John's Dutch course1 status because he completed the English course1? I am at a complete loss on how to do this with DAX formulas. 

 

Note, sometimes an employee doesn't complete any courses, so it's still important to count the expired status in certain circumstances. 

 

Thank you in advance!

1 ACCEPTED SOLUTION

@Anonymous 

 

I am still not sure the table you showed previously was a table in your powerbi or had measure in it.

 

I assumed it was a table.

 

You can create a column.

Final status = if('Sheet25'[Course1 status_1]="Completed","Completed",'Sheet25'[Course1 status])

1.PNG

Or you can create two measures

compolte = CALCULATE(COUNTROWS(Sheet25),FILTER(Sheet25,Sheet25[Course1 status]="Completed" || 'Sheet25'[Course1 status_1]="Completed"))

not completed = CALCULATE(COUNTROWS(Sheet25),FILTER(Sheet25,Sheet25[Course1 status]="Expired" && 'Sheet25'[Course1 status_1]="Expired"))

2.PNG

Hope this is helpful.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

 

Is the table you showed a visual or raw data? and could you please show the expected results?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan, 

 

Thank you for responding. The final results should look something like this: 

Users who completed course 1 = 3 (John, Michael, Anne)

Users who did not complete course 1 = 1 (Rose)

 

How it looks right now in my PowerBI is this:

Users who completed course 1 = 3 (John, Michael, Anne)

Users who did not complete course 1 = 4 (John, Michael, Anne, Rose)

 

@Anonymous 

 

I am still not sure the table you showed previously was a table in your powerbi or had measure in it.

 

I assumed it was a table.

 

You can create a column.

Final status = if('Sheet25'[Course1 status_1]="Completed","Completed",'Sheet25'[Course1 status])

1.PNG

Or you can create two measures

compolte = CALCULATE(COUNTROWS(Sheet25),FILTER(Sheet25,Sheet25[Course1 status]="Completed" || 'Sheet25'[Course1 status_1]="Completed"))

not completed = CALCULATE(COUNTROWS(Sheet25),FILTER(Sheet25,Sheet25[Course1 status]="Expired" && 'Sheet25'[Course1 status_1]="Expired"))

2.PNG

Hope this is helpful.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




MFelix
Super User
Super User

Hi @Anonymous ,

 

Not really  sure if this solution includes all the options but based on the information you present why don't you make an additional column that compares both status:

if ([Course1 status]=[Course1 status.1]) = true then [Course1 status] else List.Min({[Course1 status],[Course1 status.1]})

Result is below:

course.png

Now use this new column to calculate your desired KPI's.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors