Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I need to create a calculation showing departments counts of employees working onsite vs virtual. I tried several measures/calculated column but I was stuck at the "Work Location Type" column. It won't do a distinct count of the departments. Please see the result table I am trying to achieve. The last column uses the following criteria:
If Onsite is 0 and Virtual >0 return "Virtual"
If Onsite >0 and Virtual = 0 return "Onsite"
If Onsite > 0 and Virtual > 0 return "Onsite & Virtual "
Original Table
| Department | Work Location |
| HR | Onsite |
| HR | Onsite |
| HR | Onsite |
| HR | Onsite |
| Claims | Onsite |
| Claims | Virtual |
| Underwriting | Onsite |
| Underwriting | Onsite |
| Underwriting | Virtual |
| Underwriting | Virtual |
| Underwriting | Virtual |
| Operations | Virtual |
| Operations | Virtual |
Result Table
| Department | Onsite | Virtual | Total Onsite/Virtual | Work Location Type |
| HR | 4 | 0 | 4 | Onsite |
| Claims | 1 | 1 | 2 | Onsite & Virtual |
| Underwriting | 2 | 3 | 5 | Onsite & Virtual |
| Operations | 0 | 2 | 2 | Virtual |
Any assistance will be greatly appreciated
Solved! Go to Solution.
Hi @Jadegirlify - Yes you can create it by using below measures and display the output in table chart from same original table.
Measure for Onsite Count:
Onsite Count =
CALCULATE(
COUNT('OriginalTable'[Work Location]),
'OriginalTable'[Work Location] = "Onsite"
) +0
Measure for Virtual Count:
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
@rajendraongole1 Thanks it worked. Is there a way to achieve these calculations in the original table without creating a calculated table? I am unable to connect it to the original table and I need a bunch of filters from the original table.
Hi @Jadegirlify - Yes you can create it by using below measures and display the output in table chart from same original table.
Measure for Onsite Count:
Onsite Count =
CALCULATE(
COUNT('OriginalTable'[Work Location]),
'OriginalTable'[Work Location] = "Onsite"
) +0
Measure for Virtual Count:
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
@rajendraongole1 Also with the same table, I would like to have this output table:
Original Table
| Department | Work Location |
| HR | Onsite |
| HR | Onsite |
| HR | Onsite |
| HR | Onsite |
| Claims | Onsite |
| Claims | Virtual |
| Underwriting | Onsite |
| Underwriting | Onsite |
| Underwriting | Virtual |
| Underwriting | Virtual |
| Underwriting | Virtual |
| Operations | Virtual |
| Operations | Virtual |
Result Table (Total HR count is 4 and all 4 are onsite, that's why virtual is 0 etc)
| Department | Total Department | Work Location | Onsite | Virtual | Total |
| HR | 13 | Onsite | 4 | 0 | 4 |
| HR | 13 | Onsite | 4 | 0 | 4 |
| HR | 13 | Onsite | 4 | 0 | 4 |
| HR | 13 | Onsite | 4 | 0 | 4 |
| Claims | 13 | Onsite | 1 | 0 | 2 |
| Claims | 13 | Virtual | 0 | 1 | 2 |
| Underwriting | 13 | Onsite | 2 | 0 | 5 |
| Underwriting | 13 | Onsite | 2 | 0 | 5 |
| Underwriting | 13 | Virtual | 0 | 3 | 5 |
| Underwriting | 13 | Virtual | 0 | 3 | 5 |
| Underwriting | 13 | Virtual | 0 | 3 | 5 |
| Operations | 13 | Virtual | 0 | 2 | 2 |
| Operations | 13 | Virtual | 0 | 2 | 2 |
@rajendraongole1 Do you happen to had a mesure to obtain the follow columns above: Total Department, Onsite, Virtual and Total.
@Jadegirlify Thanks for confirming and Happy to Help!!
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi @Jadegirlify - Create a calculated Table
create two calculated columns , one for to calculate Total Online/Virtual and another worklocation using switch statements.
Proud to be a Super User! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |