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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
NILU090
Helper II
Helper II

Need to take sum of salary. attached data model

Hi Team,

Inshort, I want to take sum of salary (from Fact table) vs State(from Code table).

Manager Hierarchy R_ID to Fact Table R_ID inactive relationship.

 

NILU090_0-1724673117592.png

 

8 REPLIES 8
Anonymous
Not applicable

Hi,

Thanks for the solution Gabry provided, and i want to offer some more infotmation for user to refer to.

hello @NILU090 , you can try the following meaure.

MEASURE =
CALCULATE (
    SUM ( Fact_Table[Salary] ),
    USERELATIONSHIP ( Fact_Table[R_ID], ManagerHierachy[R_ID] ),
    CROSSFILTER ( Groups[CODE], ManagerHierachy[CODE], BOTH )
)

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

NILU090
Helper II
Helper II

code and manager hierarchy doesnt have any direct , indirect relationship

 

Yeah I see, but the key "CODE" is the same, so you can build a relationship between these tables. So if you set a relationship, will it be 1:1 or what type?

we cant modified the relationship. This is what we have. on basis of that need to write dax.

Ok. In my opinion you can't do that just with DAX without make any modification to the model but wait for the help of experts 😉

Gabry
Super User
Super User

Hello @NILU090 ,

not sure but try this

 

Measure = calculate(sum(''Fact table'[Salary]), userelationship('Fact table'[R_ID], 'Manager hierarchy'[R_ID]))

let me know

Its not working.

Manager hierarchy filters to groups ( Manager hierarchy 1 side : groups many side)

Oh sorry you're right. So wich is the relationship between code and manager hierarchy?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors