question

TangiralaDineshReddy-1882 avatar image
0 Votes"
TangiralaDineshReddy-1882 asked Lz-3068 commented

Departmentwise min,max salary and count or rows using powerbi

I have table like below

116391-image.png


I want to display min(salary),max(Salary) and count(rows) by department wise like below using powerbi measures(Dax).

116386-image.png



note
not using group by in transform


  • note



power-query-not-supported
image.png (5.1 KiB)
image.png (4.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Lz-3068 avatar image
0 Votes"
Lz-3068 answered Lz-3068 commented

@TangiralaDineshReddy-1882

In this Excel workbook 4 DAX Measures to get what you want:

116610-demo.png

Min_Eno

 =CALCULATE (
     MIN ( Table1[eno] );
     FILTER ( Table1; Table1[salary] = MIN ( Table1[salary] ) )
 )

Min_Salary

 =CALCULATE (
     MIN ( Table1[salary] );
     FILTER ( Table1; Table1[salary] = MIN ( Table1[salary] ) )
 )

Max_Salary

 =CALCULATE (
     MAX ( Table1[salary] );
     FILTER ( Table1; Table1[salary] = MAX ( Table1[salary] ) )
 )

Count_Rows

 =COUNTROWS(Table1)

Note: IMHO Min_Eno makes no sense at all from a business point of view. If, for the same [deptno], 2 (or more) Min_Salary equal - see my example with [deptno] = 2 - what's the point?



demo.png (64.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @TangiralaDineshReddy-1882
Have you seen the above Answer? Does this help? ... Post back please & Thanks

0 Votes 0 ·