Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to get average salary from Employee depending upon the # of rows returned.
_m = IF ( CALCULATE ( AVERAGE( 'Employee'[Salary] ) = BLANK () ),0, CALCULATE ( AVERAGE( 'Employee'[Salary] )) )
Now i want to do the same for Employee Name as well
_m = IF ( CALCULATE ( Value( 'Employee'[Name] ) = BLANK () ),"", CALCULATE ( Value( 'Employee'[Name] )) )
But here i am getting error Employee[Name] is not defined. Kindly guide me about this. Thanks
Solved! Go to Solution.
Hi @Anonymous
I can reproduce your problem.
When I select Modeling->create column,
I can get "average per cate" and can make the "name" column convert to number type by the column or by changing the "Modeling"->"data type".
ave_per_cate = CALCULATE(AVERAGE('Table'[Salary]),FILTER('Table','Table'[cate]=EARLIER('Table'[cate])))
name_to = IF([Name]=BLANK(),BLANK(),VALUE([Name]))
Hi @Anonymous
I can reproduce your problem.
When I select Modeling->create column,
I can get "average per cate" and can make the "name" column convert to number type by the column or by changing the "Modeling"->"data type".
ave_per_cate = CALCULATE(AVERAGE('Table'[Salary]),FILTER('Table','Table'[cate]=EARLIER('Table'[cate])))
name_to = IF([Name]=BLANK(),BLANK(),VALUE([Name]))
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |