Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
I have created a report that show personel data. To visualize the number of employees for each visualisation I am using a DISTINCTCOUNT measure on the unique employee identifier. My issue now is that when I filter on, for example, country, the other visualizations shows the percentage of total, and not a percantage of total only in that country.
How it looks without filter active
How it looks with a filter on Company
In the above view I would like the "Employee vs Consultants" + "Job Classifications" visuals to only show the percentage for the people in the chosen company, so that the sum is still 100%. I was hoping to achieve this with an ALLSELECTED measure, but I can't combine it with the DISTINCTCOUNT (to my knowledge), and if I only put ALLSELECTED(Employee_Identifier) the visual gives an error saying the measure is providing multiple inputs where there should only be one.
Thanks,
Hi, @SajmenB
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:
Employee Percentage =
DIVIDE(
DISTINCTCOUNT('Imformation'[employee]),
CALCULATE(
DISTINCTCOUNT('Imformation'[employee]),
ALLSELECTED('Imformation')
)
)
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
https://drive.google.com/drive/folders/1g40xEHjmjFyWMiMkeLHAyET_Kg-E1rL8?usp=sharing
I hope you can find the pbix file here with the attached sample CSV file. I didn't manage to change the source myself from the sharepoint to the offline file.
You will notice when filtering on "Company" the other visuals does not show the percentage for that company only, but for the total. This is the issue.
I also tried using a
CALCULATE(
DISTINCTCOUNT('TABLE'[FIELD TO AGGREGATE])
ALLSELECTED(FILTER)
)
But it returned the original result whatever i put in the filter
User | Count |
---|---|
94 | |
89 | |
79 | |
77 | |
71 |
User | Count |
---|---|
116 | |
107 | |
88 | |
64 | |
63 |