Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TKent
Regular Visitor

Dax codes different between the Database table level model and Analysis Services data model ?

Hi  admin,


I have an analysis service data model(production). the table structure is like the following:
WODim, WOFact, and CDim.
WOFact has a relationship with CDim based on the WOFact[SCKey] and CDim[CKey]
WOFact has a relationship with WODim based on the WOFact[WOKey] and WODim[WOKey] (2 direction ways)
WODim and CDim don't have a relationship
WODim has a column [WOTFGroup] containing the value ("Break Fix", "Delivery", "Other, "PM")
CDim has a column [TSC] containing employee names ("Colin Musser", "Tony Wiedman", " Colby Krenz", ...)

I want to create a Calculated column [AssignedTSC] in the WODim.
So I created a table-level data model with the same relationship as the analysis services data model in the Power BI desktop.

 

My DAX code:
AssignedTSC =
IF('WODim'[WOTFGroup]="Delivery","Collin Musser",
IF('WODim'[WOTFGroup]="PM","Tony Wiedman",
related('CDim'[TSC]) ))

 

The code works well in the database table model but doesn't work in the analysis services data model.

it seems there are some more strict policies of DAX in the analysis services data model.

Thank you for your help.

 

4 REPLIES 4
TKent
Regular Visitor

Warning message:

"The column 'Customer[TechServiceCoordinator]' either doesn't exist or doesn't have a relationship to any table available in the current context. "

Then once in Model pane chech whether the relation b/w WODim and Customer is present or not.

Abhinav054
Helper I
Helper I

Hii, nce use following DAX expression

AssignedTSC =
                        VAR WOFact = CALCULATE( WOFact,
                                                                       FILTER( WOFact,

                                                                                        WOFact[WOKey] = CURRENTROW(WODim)[WOKey]))
                         RETURN
                                IF(
                                     CURRENTROW(WODim)[WOTFGroup] = "Delivery", "Collin Musser",
                                                                               IF( CURRENTROW(WODim)[WOTFGroup] = "PM",

                                                                                         "Tony Wiedman",
                                      WOFact[TSC]))

Abhinav054,
Thank you!
The [TSC] exists in the CDim table, not in the WOFact.
PREVIEW
error message: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
 
 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.