The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Edit: Simplified my example and description to make it easier to understand.
I have a data like below. The table contains employees and managers. Managers are also present as employee records.
I want to calculate the no. of emps per manager title. I am trying to populate the below table visual and am having a challenge in getting the highlighted value.
Solved! Go to Solution.
Hi @kk_shp_user
Try using TREATAS
Total_Emps_at_Title =
CALCULATE (
COUNTROWS ( 'Table' ),
TREATAS ( VALUES ( 'Table'[recruiter_title] ), 'Table'[emp_title] )
)
Hi @kk_shp_user
Try using TREATAS
Total_Emps_at_Title =
CALCULATE (
COUNTROWS ( 'Table' ),
TREATAS ( VALUES ( 'Table'[recruiter_title] ), 'Table'[emp_title] )
)
Thanks for yourt reply but the solution did not get the expected result.
Apologies, its sensistive data hence posted an exmaple.
That said, than you so much. I got it to work using TREATAS() like you mentioned. I was using a measure inside the calculate and so had to add the ALLEXCEPT condition to remove ther filters affecting the measure and the TREATAS worked as expected.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |