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 all,
I posted a question here this morning but I didn't get the full solution, so I thought I would post here where I got stuck at.
I want to add a new column saying 'Customer type change?' = "1" if the product is different bettween the columns (First_CustType and CurrentCustType) and "0" if they have the same product.
A super user friend adviced me using the below.
Column = IF([First_Product] = [CurrentProduct],0,1)
For the highlighted below, do they need to be a measure? The columns from my table are just fields from different tables (Cust_ID and First_CustType come from the table ProductAcquisition, and CurrentCustType comes from the table CustomerType. I tried to create both measures so I can create the measure below but it's not working. Se below the error I get.
How can I get this done?
Thank you.
Solved! Go to Solution.
Hi @ROG ,
Please try below options:
My test table:
ProductAcquisition:
CustomerType:
Model:
Try below DAX to add new column in table ProductAcquisition:
CurrentCustType_FromCT = RELATED(CustomerType[CurrentCustType])
Column = if([First_CustType]= [CurrentCustType_FromCT],1,0)
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ROG ,
Please try below options:
My test table:
ProductAcquisition:
CustomerType:
Model:
Try below DAX to add new column in table ProductAcquisition:
CurrentCustType_FromCT = RELATED(CustomerType[CurrentCustType])
Column = if([First_CustType]= [CurrentCustType_FromCT],1,0)
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey,
In measures you cannot directly refer to columns, because there is no row context. Your matrix contains the columns, so based on the filter context per row there is only one value for the columns. We can retrieve this single value using the SELECTEDVALUE function. Use this code for your measure:
Measure =
INT (
SELECTEDVALUE ( ProductAcquisition[First_Product] )
= SELECTEDVALUE ( ProductAcquisition[Current_Product] )
)
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 | |
15 | |
10 |
User | Count |
---|---|
57 | |
50 | |
44 | |
21 | |
19 |