Forum Discussion
bahadbey
7 years agoNew Member
I'm having trouble converting an SQL query to DAX
Hello everyone, I'm trying to calculate a turnover indicator for certain departements but I'm having trouble converting an SQL into DAX. Here is my sql query which works using MSSQL Server. ...
parry2k
Super User
7 years agobahadbey share sample data but it will look something like this
YourMeasure = DIVIDE( CALCULATE( COUNTROWS(Table), NOT ISBLANK(Table[ValidTo]), Table[EmployeeDept] = "1" ), CALCULATE( DISTINCTCOUNT(Table[EmployeeAltID]), NOT ISBLANK(Table[ValidTo]), Table[EmployeeDept] = "1" ) )
bahadbey
7 years agoNew Member
Actually my EmployeDept column type is Int and not String.
Here is my sample data.
This is the output of SQL Server