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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Switch between ID/assign to another ID

Hi.

I don't have a sample dataset so I will try my best to describe my question. 

I have three tables:

  • Product
  • Shoes
  • Sales

I have a measure that calculates total sales by a product Id. Here is an example: 
Measure 1 = Calculate(sum(Sales[total]));Product[ProductId] = 1111)

 

But I want to assign Measure 1 to a ShoeId from another table. Something like this: 

Measure 2 = Calculate[Measure 1] where Product[ProductId] = 1111 is in Shoe[ShoeId] = 222222


Is this possible? 

Thanks

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

Is this what you want? Maybe you can use matrix directly to sum sales.

b11.PNG

 

 

b12.PNG

(data model)

 

Best regards,
Lionel Chen

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

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

Is this what you want? Maybe you can use matrix directly to sum sales.

b11.PNG

 

 

b12.PNG

(data model)

 

Best regards,
Lionel Chen

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

Hi,

but please use the "correct" (one-to-many) relationships.

Relation_Shoe.png

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @Anonymous ,

 

try to create a small sample dataset.

You can use the function "Enter data" for that.

https://docs.microsoft.com/en-us/power-bi/desktop-enter-data-directly-into-desktop

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Hi @mwegener ,

Thank you for trying to help me. 

Sales table

SalesProductFKShoeFK
3412321
6512423


Product table

ProductPKProduct codeProduct name
12311111Beans
12411114Billy

 

Shoe table

ShoePKShoe codeShoe name
21222222Green

 

Now, I want to have a measure that calculates the total sales for Product code=1111, but I want to "assign" it to Shoe code= 222222 instead. Because products can have many shoes, so I just want to assign it to one shoe which is 222222

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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