Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
So I have a fact table like sales data and product dimensional table. They are connected by product id. However, not all records from fact table have product id. I am wondering could I do some sort of DAX measure like following:
IF('fact_table'[product_id] = blank(),
'product_table'[product_category],
"something else" --- I would retrieve some text from a field in fact table, but I would like to know if this would work for fact table not containing key to dimension table
Thanks,
Solved! Go to Solution.
Hi @Paulb123 ,
You can try formula like below to create calculated column:
ProductCategoryOrText =
IF(
ISBLANK('fact_table'[product_id]),
'fact_table'[description],
RELATED('product_table'[product_category])
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Paulb123 ,
You can try formula like below to create calculated column:
ProductCategoryOrText =
IF(
ISBLANK('fact_table'[product_id]),
'fact_table'[description],
RELATED('product_table'[product_category])
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Create a New Column
Enter the following DAX formula
ProductCategoryOrDefault =
IF(
ISBLANK('fact_table'[product_id]),
"No Product ID",
LOOKUPVALUE(
'product_table'[product_category],
'product_table'[product_id],
'fact_table'[product_id],
"Category Not Found"
)
)
Here's what the formula does:
@Paulb123 , You can use calculated column using related function
NewColumn =
IF(
ISBLANK('fact_table'[product_id]),
RELATED('product_table'[product_category]),
"Some other text from fact table"
)
Proud to be a Super User! |
|
User | Count |
---|---|
143 | |
71 | |
69 | |
53 | |
52 |
User | Count |
---|---|
208 | |
94 | |
64 | |
60 | |
57 |