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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
arlequin71
Helper II
Helper II

Calculate Sales on related dim_Product table

Hello,

Anyone can help me to build a metric to calculate Sales of Prioritized Products to be compare with No Prioritized Productcs?.  These products are country associated.

 

Thanks in advance for your help.

 

2021-04-05_18h21_37.png

 

 

 

 

 

 

 

 

 

 

Sales Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg1W0lEKKMpPKU0uUXAEsg0NDICkkaGugaGukYGRoVKsTrSSUxC6KhMsqpx9kFQ5gVQZYVHliGyWM0iVIRZVoZHoZmFzF4oqkFmWhCzEaRSK412AbAts9gWjG4XV7cHoPsSwMBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Country = _t, Product = _t, Sales = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}, {"Product", type text}, {"Sales", Int64.Type}, {"Date", type text}})
in
    #"Changed Type"


dim_Product
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKTylNLlFwVNJRAmNHpVgdhLATdmFnoJATprALdmFXoBBYh5NSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, #"Categoy 1" = _t, #"Category 2" = _t])
in
    Source


Prioritized Products
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKTylNLlFwVNJRCg1WitVBCDljCjkBhRyDUIQcsQs5+2CYhSYEtjESw3gnVLNcoI6IBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Country = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Country", type text}})
in
    #"Changed Type"


dim_country
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg1WitWJVnL2AVOOQWAqNBJMOQF5sQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Country = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}})
in
    #"Changed Type"

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Share some data, describe the business context and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

v-jingzhang
Community Support
Community Support

Hi @arlequin71 

I add a table into your model and modify table relationships as below.

041502.jpg

In the new table, Is Prioritized Product column is used to tell whether a product is a prioritized product in a country.

041503.jpg

I display the sales in a matrix visual like below. You can download the attachment for details.

041504.jpg

Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @arlequin71 

I add a table into your model and modify table relationships as below.

041502.jpg

In the new table, Is Prioritized Product column is used to tell whether a product is a prioritized product in a country.

041503.jpg

I display the sales in a matrix visual like below. You can download the attachment for details.

041504.jpg

Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Ashish_Mathur
Super User
Super User

Hi,

Share some data, describe the business context and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors