Forum Discussion
IF in DAX Studio
Hi,
Please share your sample pbix file's link with how your expected outcome looks like.
Thanks.
Hi, I cant share the data but this the code I have
In bold is the part that I am trying to add, above is the suggestion you made
EVALUATE
ADDCOLUMNS (
SUMMARIZE (
VALIDATED_PD,
VALIDATED_PD[m_Group_Currency_Amount],
VALIDATED_PD[d_Customer_Name]
),
"Total Overdue", [a_TotalOverdue],
"Customer Name",
VAR f_GM_CustomerPD = VALIDATED_PD[d_Customer_Name]
RETURN
IF ( f_GM_CustomerPD = "GM", "GM", VALIDATED_PD[d_Customer_Name] ),
"Customer Number",
VAR f_GM_CustomerPD = VALIDATED_PD[d_Customer_Name]
VAR f_GM_CustomerNumber = VALIDATED_PD[m_Customer_Number]
RETURN
IF ( f_GM_CustomerPD = "GM", BLANK(), f_GM_CustomerNumber )
)
And this the error:
- Jihwan_Kim3 years ago
Super User
Hi,
Sorry, this does not help to understand what/how is your expected outcome.
Please try something like below.EVALUATE table = ADDCOLUMNS ( SUMMARIZE ( VALIDATED_PD, VALIDATED_PD[m_Group_Currency_Amount], VALIDATED_PD[d_Customer_Name], VALIDATED_PD[m_Customer_Number] ), "Total Overdue", [a_TotalOverdue], "Customer Name", VAR f_GM_CustomerPD = VALIDATED_PD[d_Customer_Name] RETURN IF ( f_GM_CustomerPD = "GM", "GM", VALIDATED_PD[d_Customer_Name] ), "Customer Number", VAR f_GM_CustomerPD = VALIDATED_PD[d_Customer_Name] VAR f_GM_CustomerNumber = VALIDATED_PD[m_Customer_Number] RETURN IF ( f_GM_CustomerPD = "GM", BLANK (), f_GM_CustomerNumber ) )