cancel
Showing results for 
Search instead for 
Did you mean: 
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
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors