Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
71 | |
70 | |
38 | |
27 | |
26 |
User | Count |
---|---|
97 | |
96 | |
59 | |
44 | |
40 |