Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
HI Experts,
Could anyone please translate below DAX into SQL please
1. AIMS = IF(LEN(A.L)>=10 and IFERROR(VALUE(RIGHT(Asset[A_L],1)),FALSE()),"AIMS","ANIMS")
2. AIMS = IF(Asset[AGAL] IN DISTINCT('H S'[AG]) && A[AIMS]="AIMS","I M S","N i M S")
3. AGAL = A[A_L] & "_" & A[AG]
4. AIMLS = IF(Asset[AGAL IN DISTINCT('H S'[AG]) && Asset[AIMxS]="AIMXS","I M S","N in M S")
thanks
Solved! Go to Solution.
Hi!
The DAX expressions you provided can be translated into SQL as follows:
For the DAX expression:
AIMS = IF(LEN(A.L)>=10 and IFERROR(VALUE(RIGHT(Asset[A_L],1)),FALSE()),"AIMS","ANIMS")
The SQL translation would be:
CASE
WHEN LEN(A.L) >= 10 AND ISNUMERIC(RIGHT(Asset.A_L, 1)) = 1 THEN 'AIMS'
ELSE 'ANIMS'
END AS AIMS
For the DAX expression:
AIMS = IF(Asset[AGAL] IN DISTINCT('H S'[AG]) && A[AIMS]="AIMS","I M S","N i M S")
The SQL translation would be:
CASE
WHEN Asset.AGAL IN (SELECT DISTINCT AG FROM H_S) AND A.AIMS = 'AIMS' THEN 'I M S'
ELSE 'N i M S'
END AS AIMS
For the DAX expression:
AGAL = A[A_L] & "_" & A[AG]
The SQL translation would be:
CONCAT(A.A_L, '_', A.AG) AS AGAL
For the DAX expression:
AIMLS = IF(Asset[AGAL IN DISTINCT('H S'[AG]) && Asset[AIMxS]="AIMXS","I M S","N in M S")
The SQL translation would be:
CASE
WHEN Asset.AGAL IN (SELECT DISTINCT AG FROM H_S) AND Asset.AIMxS = 'AIMXS' THEN 'I M S'
ELSE 'N in M S'
END AS AIMLS
Hi!
The DAX expressions you provided can be translated into SQL as follows:
For the DAX expression:
AIMS = IF(LEN(A.L)>=10 and IFERROR(VALUE(RIGHT(Asset[A_L],1)),FALSE()),"AIMS","ANIMS")
The SQL translation would be:
CASE
WHEN LEN(A.L) >= 10 AND ISNUMERIC(RIGHT(Asset.A_L, 1)) = 1 THEN 'AIMS'
ELSE 'ANIMS'
END AS AIMS
For the DAX expression:
AIMS = IF(Asset[AGAL] IN DISTINCT('H S'[AG]) && A[AIMS]="AIMS","I M S","N i M S")
The SQL translation would be:
CASE
WHEN Asset.AGAL IN (SELECT DISTINCT AG FROM H_S) AND A.AIMS = 'AIMS' THEN 'I M S'
ELSE 'N i M S'
END AS AIMS
For the DAX expression:
AGAL = A[A_L] & "_" & A[AG]
The SQL translation would be:
CONCAT(A.A_L, '_', A.AG) AS AGAL
For the DAX expression:
AIMLS = IF(Asset[AGAL IN DISTINCT('H S'[AG]) && Asset[AIMxS]="AIMXS","I M S","N in M S")
The SQL translation would be:
CASE
WHEN Asset.AGAL IN (SELECT DISTINCT AG FROM H_S) AND Asset.AIMxS = 'AIMXS' THEN 'I M S'
ELSE 'N in M S'
END AS AIMLS
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |