Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 @aaslam
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 @aaslam
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 |
---|---|
42 | |
27 | |
24 | |
20 | |
16 |
User | Count |
---|---|
54 | |
35 | |
19 | |
18 | |
15 |