March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have a table contans customerId, Code columns. I want to add calculated column and populate either ture or false.
The condition is if any customer contains code C or D, then i need to add value true for all records associated to that customerId else false.
Below is the sample data. you will see false for all records for customer id 102 as no C or D code records for 102.
Could you please help me to resolve the issue?
Solved! Go to Solution.
Hi @pprasadravi ,
You could create a new column like the below:
Column =
IF (
CONTAINS (
FILTER ( Customer, Customer[CustomerID] = EARLIER ( Customer[CustomerID] ) ),
Customer[Code], "C"
)
= TRUE ()
|| CONTAINS (
FILTER ( Customer, Customer[CustomerID] = EARLIER ( Customer[CustomerID] ) ),
Customer[Code], "D"
)
= TRUE (),
TRUE (),
FALSE ()
)
Output result:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @pprasadravi ,
You could create a new column like the below:
Column =
IF (
CONTAINS (
FILTER ( Customer, Customer[CustomerID] = EARLIER ( Customer[CustomerID] ) ),
Customer[Code], "C"
)
= TRUE ()
|| CONTAINS (
FILTER ( Customer, Customer[CustomerID] = EARLIER ( Customer[CustomerID] ) ),
Customer[Code], "D"
)
= TRUE (),
TRUE (),
FALSE ()
)
Output result:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi,
Thak you for the quick response.
I want to have true or false for all rows for a customer ID. That means I have to update false for all records realed to 102 and update true for all records related to 100 and 101 as they have C or D records.
I think i am able to resolve the issue using below DAX. But i am not sure this is the efficient way or not.
IF(Code == "C" || Code == "D" ,"True","False")
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |