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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
LemonKing
Frequent Visitor

Display Completion Rate (Arrangement of column matters?)

Dear All, 

 

This might be a easy one for you all but no matter how i placed/set the values, im not able to display the completion count in column chart properly. 

 

Staff IDNameDepartmentTraining NameMandatory25-Oct25-Sep25-Aug25-Jul25-Jun25-May25-Apr25-Mar25-Feb25-Jan
ID100JohnSalesTraining 6YesCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompleted
ID101MayHRTraining  2YesExpiredExpiredExpiredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID107ChrisFinanceTraining  2YesCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompleted
ID103jamesLogisticsTraining 1YesCompletedCompletedCompletedCompletedCompletedCompletedRegisteredRegisteredRegisteredRegistered
ID104MarySalesTraining 7NoCompletedCompletedRegisteredExpiredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID105GwenRetail Training 9NoRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID106VivianHRTraining 3YesCompletedCompletedCompletedRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID107ChrisFinanceTraining 10NoCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompleted
ID108JoeFinanceTraining 5YesCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedRegistered
ID109CammyLogisticsTraining 9NoCompletedCompletedCompletedCompletedCompletedRegisteredRegisteredRegisteredRegisteredRegistered
ID100JohnSalesTraining 1YesCompletedCompletedCompletedCompletedRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID104MarySalesTraining 7NoCompletedCompletedExpiredExpiredExpiredExpiredRegisteredRegisteredRegisteredRegistered
ID107ChrisFinanceTraining 9NoCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedRegisteredRegistered
ID103jamesLogisticsTraining  2YesRegisteredRegisteredRegisteredRegisteredExpiredRegisteredRegisteredRegisteredRegisteredRegistered
ID109CammyLogisticsTraining 10NoCompletedCompletedCompletedCompletedCompletedCompletedCompletedCompletedRegisteredRegistered
ID100JohnSalesTraining 8NoCompletedCompletedCompletedExpiredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID105GwenRetail Training 1YesCompletedCompletedRegisteredRegisteredRegisteredRegisteredExpiredRegisteredRegisteredRegistered
ID107ChrisFinanceTraining 8NoCompletedCompletedCompletedCompletedRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID101MayHRTraining 1YesRegisteredExpiredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered
ID108JoeFinanceTraining 3YesCompletedRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegisteredRegistered

 

How can i make this table to show in this format to display only mandatory training completion?

 

LemonKing_0-1756695451988.png

 

Appreciate if someone can show the DAX for this as majority of my table data is like this. 

 

Thanks in advanced!

 

 

 

 

1 ACCEPTED SOLUTION
FarhanJeelani
Super User
Super User

Hi @LemonKing ,

Please follow the below steps:

Data Transformation (Ungrouping)

The best way to handle this is to "unpivot" or "ungroup" your date columns. In Power BI (and similar tools), you can do this in the Power Query Editor:

Select the columns: Select "Staff ID", "Name", "Department", "Training Name", and "Mandatory".
Unpivot Other Columns: Go to the "Transform" tab and click on "Unpivot Other Columns".
Rename Columns: This will create two new columns, typically named "Attribute" (which will contain your dates) and "Value" (which will contain "Completed", "Expired", "Registered", etc.). Rename these to something like "Month" and "Status" for clarity.
After this transformation, your data will look like this:

 

Staff ID  Name    Department     Training Name       Mandatory       Month         Status
ID100    John      Sales                 Training 6               Yes                   25-Oct        Completed
ID100    John      Sales                Training 6               Yes                    25-Sep       Completed


DAX for Filtering Mandatory Training and Counting Completions

Once your data is in the long format, you can create measures in DAX.

1. Measure to count completions:

Completion Count =
CALCULATE(
COUNTROWS('YourTableName'), -- Replace 'YourTableName' with the actual name of your table
'YourTableName'[Status] = "Completed"
)

 

2. Filter for Mandatory Training (if you want to show only mandatory)

If you want to display the completion rate only for mandatory training, you can add a filter to your visual or modify the measure:

Filtering the Visual: The easiest way is to put the "Mandatory" column on the filter pane of your visual and select "Yes".

DAX Measure for Mandatory Completions:

Mandatory Completion Count =
CALCULATE(
COUNTROWS('YourTableName'),
'YourTableName'[Status] = "Completed",
'YourTableName'[Mandatory] = "Yes"
)

 

How to build the chart:

Use a Clustered Column Chart.
X-axis: Drag your "Month" column to the X-axis. Ensure it's treated as a categorical or date axis and sorted correctly.
Y-axis: Drag your Completion Count measure (or Mandatory Completion Count if you filtered for mandatory only) to the Y-axis.

 

Please mark this post as solution if it helps you. Appreciate Kudos.

View solution in original post

4 REPLIES 4
FarhanJeelani
Super User
Super User

Hi @LemonKing ,

Please follow the below steps:

Data Transformation (Ungrouping)

The best way to handle this is to "unpivot" or "ungroup" your date columns. In Power BI (and similar tools), you can do this in the Power Query Editor:

Select the columns: Select "Staff ID", "Name", "Department", "Training Name", and "Mandatory".
Unpivot Other Columns: Go to the "Transform" tab and click on "Unpivot Other Columns".
Rename Columns: This will create two new columns, typically named "Attribute" (which will contain your dates) and "Value" (which will contain "Completed", "Expired", "Registered", etc.). Rename these to something like "Month" and "Status" for clarity.
After this transformation, your data will look like this:

 

Staff ID  Name    Department     Training Name       Mandatory       Month         Status
ID100    John      Sales                 Training 6               Yes                   25-Oct        Completed
ID100    John      Sales                Training 6               Yes                    25-Sep       Completed


DAX for Filtering Mandatory Training and Counting Completions

Once your data is in the long format, you can create measures in DAX.

1. Measure to count completions:

Completion Count =
CALCULATE(
COUNTROWS('YourTableName'), -- Replace 'YourTableName' with the actual name of your table
'YourTableName'[Status] = "Completed"
)

 

2. Filter for Mandatory Training (if you want to show only mandatory)

If you want to display the completion rate only for mandatory training, you can add a filter to your visual or modify the measure:

Filtering the Visual: The easiest way is to put the "Mandatory" column on the filter pane of your visual and select "Yes".

DAX Measure for Mandatory Completions:

Mandatory Completion Count =
CALCULATE(
COUNTROWS('YourTableName'),
'YourTableName'[Status] = "Completed",
'YourTableName'[Mandatory] = "Yes"
)

 

How to build the chart:

Use a Clustered Column Chart.
X-axis: Drag your "Month" column to the X-axis. Ensure it's treated as a categorical or date axis and sorted correctly.
Y-axis: Drag your Completion Count measure (or Mandatory Completion Count if you filtered for mandatory only) to the Y-axis.

 

Please mark this post as solution if it helps you. Appreciate Kudos.

Thanks @FarhanJeelani 

 

It works! 

 

Can i also ask what if i want to count one additional status ie Completed +Expired?

 

How should i put the DAX? I tried to add one more liner but its not working. 

 

Mandatory Completion Count =
CALCULATE(
COUNTROWS('YourTableName'),
'YourTableName'[Status] = "Completed",
'YourTableName'[Status] = "Expired"

)

 

Tried 'YourTableName'[Status] = "Completed" && 'YourTableName'[Status] = "Expired" also not working. 

Hi @LemonKing ,

The issue with your attempts is how you're trying to apply multiple conditions within a single CALCULATE filter context.

When you use 'YourTableName'[Status] = "Completed", 'YourTableName'[Status] = "Expired", it's interpreted as needing a single row to satisfy both conditions simultaneously, which is impossible for a single status value. Similarly, using && (AND) logic means a row must be both "Completed" AND "Expired" at the same time.

 

To count rows that meet either one condition or another, you need to use the OR operator. In DAX, the OR operator is represented by || or the OR() function.

Below is the correct way to achieve this:

Using || (OR operator)

This is the most concise and common way to achieve the OR logic.

Completed or Expired Count =
CALCULATE(
COUNTROWS('YourTableName'),
'YourTableName'[Status] = "Completed" || 'YourTableName'[Status] = "Expired"
)

 

Please mark this post as solution if it helps you. Appreciate Kudos.

Hi @FarhanJeelani 

 

Really thanks for your detailed explaination and help on this. 

 

It cleared all my queries that has been blocking me! 

 

Appreciated!🤗

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.