- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

DAX: return group from dimension table if there are existing record and return something if not.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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:
- ISBLANK('fact_table'[product_id]) checks if the product_id in the fact table is blank.
- If the product_id is blank, it returns "No Product ID".
- If the product_id is not blank, it uses LOOKUPVALUE to find the corresponding product_category from the product table.
- If the product_id is not found in the product table, it returns "Category Not Found".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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! |
|

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
07-03-2024 06:34 AM | |||
06-17-2024 08:30 AM | |||
06-17-2024 06:37 AM | |||
07-09-2024 04:45 PM | |||
12-28-2023 06:46 AM |
User | Count |
---|---|
87 | |
81 | |
53 | |
38 | |
35 |