Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I have a couple of tables named Product and Colour and they are related by the Product ID:
Product:
Colour:
A product would have 0 or 1 active colour and 0 or more inactive ones. have imported these tables in Power BI and want to create a new column using DAX that displays the Active colour (or "None" if the product has no active colours):
I was wondering if there's a DAX expression I could use for this column?
Jason
Solved! Go to Solution.
Hi @jasonyeung87 ,
You could create a calculated column as follows.
Color =
VAR _COLOR =
CALCULATE (
MAX ( 'Colour'[Colour] ),
FILTER ( 'Colour', [Product ID] = 'Product'[Product ID] && [Status] = "Active" )
)
RETURN
IF ( ISBLANK ( _COLOR ), "None", _COLOR )
You can check more details from my attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jasonyeung87 ,
You could create a calculated column as follows.
Color =
VAR _COLOR =
CALCULATE (
MAX ( 'Colour'[Colour] ),
FILTER ( 'Colour', [Product ID] = 'Product'[Product ID] && [Status] = "Active" )
)
RETURN
IF ( ISBLANK ( _COLOR ), "None", _COLOR )
You can check more details from my attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You would use COALESCE() for that.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523