Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello, I need to sum distinct count values (employee id's) by their start year of working. I attached photo below.
I tried:
Solved! Go to Solution.
Your SELECTEDVALUE should not be on column [priimtu metai], the one you're using in your table ?
Hi @obuolys123 ,
It looks like a Running Total
You can create a measure like the one below as a first step
Employee_Count = SUM(Table [employee_id])
You can create another measure by trying the below DAX
RT distinct count of employee id :=
VAR CurrentemployeeYear = SELECTEDVALUE ( Table[Start year] )
RETURN
CALCULATE (
[Employee_Count],
Table[Start year] <= CurrentemployeeYear,
ALL ( Table[Start year] )
)
This should give you the expected result
Regards,
Hi, @Thejeswar
Thank you for help, the issue is that I can't SUM employees ids from table because they duplicate a lot, I need DISTINCT values SUM. I tried to SUM it your way, but I get enormous number. I dont really know how to sum these distinct ids, i get the idea of your suggestion, but can't really get to it. The excel photo I showed is made up, I get Column B by just distinct count of ids in PBI Desktop. Since SUM (as i know, maybe I am wrong) cant sumarise a measure (distinct count of ids) I can not get the result. Maybe you know what to do in this case?
Thank you in advance
Hi,
If you use for the measure Employee count a DISTINCTCOUNT( [employeeID] ) instead of SUM, does it works ?
Employee_Count = DISTINCTCOUNT( Table [employee_id] )
Hope it helps
Hi @AilleryO
Thank you for the help. Tried it earlier, but it did not work.
darbuotojai_imones(dirba_nuo) = table(start_date)
Priimti pamečiui = DISTINCTCOUNT(table[employee_id])
Priimtų metai = Format(table[start_date],"yyyy")
I hope you understand this explanation. Dont really have time right now to share all information and to give you pbix, I would need time to minimize the data.
Your SELECTEDVALUE should not be on column [priimtu metai], the one you're using in your table ?
Hi,
Share the link from where i can download your PBI file.
Hello, @Ashish_Mathur
I am sorry but I can not do that, since it has confidential information in it which I am not allowed to share...
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |