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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Rowbased DAX Measure doesn't work with Dim Table

Hello,

I've been puzzling and I've the feeling that I almost have the result but I'm missing something. 
I've made a sample report that represents the issue https://we.tl/t-2rSfNSPa3L 

 

There is a table Objectives that has: per (Cycle, ID, Area,  Emp) an Objective (the objective has to do with the ID and the Area, the Emp is just the person connected to the ID)
Another table Activities with: per ( Date, ID, Area, Emp) an Activity (multiple activities per cycle possible).
And a few Dim tables.

The thing that doesn't work is that I need to "cap" the [# Activities CTD] (<-- number of activities cycle to date) of the Emps if they are higher than the Objectives of the ID the activity is with. -->  I can get the information that I want if I use the EmpKey of the FactTable (see blue columns in pictue below), but not when I use the Full Name of DimEmp (see the bottom table)

sample report.png
The connections are existing (see Attachment 'data model'). 
data model.PNG
The problem lies in the measure 'Objectives': 

JasEbk_0-1633366586627.png

 

 

 

Adding the var selected_emp didn't work and userelationship didn't work either. The problem probably lies in the fact that the measure Objectives is a SELECTEDVALUE instead of a SUM. But in the input table 'Objectives'  there is always only 1 objective per (Cycle, ID, Area *and Emp), so if I just take the SUM of the objectives and do the [# Activities Capped] with the SUM of [# Activities CTD] then it doesn't take the ID into account and the activities capped doesn't make sense then. 

So I need a row based function that selects the Objectives and performs the measure  [# Activities Capped] per ID, and in a way that I can link it with DimEmp[EmpKey]  instead of only with Objectives[EmpKey]

1 REPLY 1
lbendlin
Super User
Super User

The file transfer link has expired, can you please resubmit?

 

This part

 

CALCULATE(SELECTEDVALUE())

 

has a certain smell to it. Most likely it is not what you need in this situation.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors