The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
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.
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]))
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |