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.
Hello everyone.
I have a table which contains a column with names of employees, a column with month names, and also another column which shows the values of a certain KPI for each employee, for each month. I'd like to create another column with the total average of the KPI (considering all months), for each employee. I've been able to do that, but I have a problem. Since the name of every employee is repeated 12 times (one for each month), I get repeated values of the total average in the new column I created, and I'd like to get rid of it. I'd like to have the value of the average showed only in the first time the name of the corresponding employee appears, and the remaining 11 cells for the same employee to be blank. Is it possible to do that? Thanks in advance.
Solved! Go to Solution.
@Anonymous Yes, but you will need a date or index column so that you can define "first". So a lot of times you would do something like:
Column =
VAR __Employee = [Employee]
VAR __Min = MINX(FILTER('Table',[Employee]=__Employee),[Date])
RETURN
IF([Date]=__Min,<some calc>,BLANK())
@Anonymous Yes, but you will need a date or index column so that you can define "first". So a lot of times you would do something like:
Column =
VAR __Employee = [Employee]
VAR __Min = MINX(FILTER('Table',[Employee]=__Employee),[Date])
RETURN
IF([Date]=__Min,<some calc>,BLANK())
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
30 |
User | Count |
---|---|
181 | |
83 | |
68 | |
49 | |
46 |