Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravsinghtomar
Contributor II
Contributor II

How to create new Variable based on another multiple Variable using if, else statement ?

Hello experts,

I need to create a statement for new Variable based on another multiple Variable using if, else statement.

some Variable has a different value, I needed a statement on behalf of other columns.

Find an example below:-

Variable Variable Variable Variable Variable

Needed Statement

(Result)

Column1Column2Column3Column4Column5Permission.Check
1PermissionJohn AllowPermission
1PermissionJohn AllowPermission
1DeleteJohn AllowPermission
2PermissionJohn AllowDelete
2PermissionJohn AllowDelete
2DeleteJohn AllowDelete
2DeleteJohn AllowDelete
3PermissionJohn Allow 
3DeleteJohn Allow 
4PermissionJohnXYZAllow 
4DeleteJohn Deny 

 

Power BI DAX Queries given below. I need syntax similar to these:-

Power BI DAX Queries:-

Permissions.Check =

VAR Permissions = CALCULATE(COUNTROWS(TableName),ALLEXCEPT(TableName,TableName[column1],tableName[column2]))

VAR Delete =
    CALCULATE(
        COUNTROWS(TableName),
            FILTER(
                ALLEXCEPT(TableName,TableName[column1],TableName[column2]),
                    TableName[column3]="John"&&
                    ISBLANK(TableName[column4])
                )
            )

RETURN
SWITCH(TRUE(),
    TableName[column5]<>"Allow",BLANK(),

    Permissions=2&&Delete=1,"Permission",

    Permissions=2&&Delete=2,"Delete",

   BLANK()

)

Labels (2)
0 Replies