Hi,
I have some issues when implement the IF condition inside the IF condition to related two tables in Parameter Filter condition.
Please find the sample query below,
evaluate
summarize (
calculatetable(
'BM',
IF(@parwl="ALL",1=1,
IF(@parsroom ="ALL",1=1,pathcontains(@
IF(@parmtype ="ALL",1=1,pathcontains(@
[M_Type].[char_val_txt],"NULL"
),
'BM'[Item_Id],
'BM'[W_L],
'BM'[Sroom],
.
.
.
.
.
.
.
.
.
.
.
.
)
In this query the 3rd parameter(parmtype) i want to compare the condition as like below with two tables in parameter filters.
Equivalent SQL:
sel col1,col2,col3 from table1 (where case when table4.col1 ='M_Type' then table4.col2 else null end in (?) or 'ALL' in (?))
group by 1,2,3
the above query is using in SSRS report now i want to implement the same in DAX
Main Dataset Table:
i want to compare based on the column value has two values 'Machine_type' & 'Item_Category'. if the condition as 'Machine_Type' then it should take the values from other table column([M_Type].[char_val_txt]) and have to compare against [BOM] table column else it should give as NULL.
[M_type] Table result:
ID Im_Categor Im_char_txt
1 M_Type XYZ
2 I_Category ABC
3 M_Type UVW
4 I_Category DEF
[BM] Table Result:
ID s_roomm M_Type
1102XYZ
2 103 ABC
3104 UVW
4105 DEF
M_Type table i am going to use it a Parameter dataset.
In main dataset ([BM]) if i will give any M_type as XYZ, then it should seacrh like below condition in Main dataset filters
sel col1,col2,col3 from table1 (where case when M_type.Im_char_txt ='M_Type' then BM.M_type else null end in (?) or 'ALL' in (?))
I want to write same like above condition in DAX on above mentioned query.
I have tried few method as like above. But not sure how to write the queries for two related tables related in SSAS model.