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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
amirabedhiafi
Impactful Individual
Impactful Individual

Get the list of sending and receiving agents in two separated filters

 I have a fact table and a dimension in my model in Power BI :

 

ShipmentID SendingAgentCode ReceivingAgentCode

1000            12                            13

1001            14                            15

 

My model is like below : 

amirabedhiafi_0-1616773579937.png

I want to have two filters one for Receiving Agents and one for Sending Agents. How can I achieve that?

Also, I want to calculate the number of shipments for Receiving/Sending Agents separetly.

 

This is what I tried : 

SendingAgent = LOOKUPVALUE(Agent[AgentCode],Agent[AgentName],Summarize(Shipment,Shipment[SendingAgentCode]))
Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
1 ACCEPTED SOLUTION
amirabedhiafi
Impactful Individual
Impactful Individual

I ended up creating a separate table :

DimSendingAgent = ALL (DimAgent)

And then created the missing relationship to this new table. This is a common practice for relatively small tables using Power BI.

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

View solution in original post

3 REPLIES 3
amirabedhiafi
Impactful Individual
Impactful Individual

I ended up creating a separate table :

DimSendingAgent = ALL (DimAgent)

And then created the missing relationship to this new table. This is a common practice for relatively small tables using Power BI.

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
Jihwan_Kim
Super User
Super User

Hi, @amirabedhiafi 

Please correct me if I wrongly understand your question.

In my opinion, please try to create two relationship lines inactive.

And when you create measures, you can use userelationship function in your measure to calculate per SendingAgent or per ReceivingAgent.

 

If it is OK with you, please share the sample pbix file, then I can look into it to come up with a more accurate solution.

 

Thank you.

 

Jihwan Kim

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

I already created two inactive relationships. I can't share the pbix file since it is containing sensitive data.

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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