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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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