cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jstern1 Frequent Visitor
Frequent Visitor

Filter Costs by Region, or Update Query Data with Proper Costs Column

Hi Everyone,

 

I could use some help in figuring out how to best find the aggregate costs of goods sold based on region.

 

Say a good costs $1 in the US, $2 in Europe, and $3 in Asia. Each specific sale is a separate row in my data set, however the cost of the good is not directly mapped to the sale based on region. I have a column that states which sale the region was made, but for the cost, I have separate columns for the $1, $2, and $3(the US Cost column has $1 for every row, Europe shows $2 for every row, etc.) . Is there a way to connect the proper cost for each sale in a single column (i.e. if the sale was in Europe, it will know to make the cost column say $2)? Or, is there an M code to filter it by cost based on region?

 

For example, I have the costs for each region placed in separate columns (EMEA = EU and APAC = AP - in the region column). Is there a way I can make a new column that assigns the appropriate cost for each row depending on the region, rather than having three separate columns? Or is there an M code that can filter it out at a later stage?

 

Capture.PNG

 

Thanks!   

1 ACCEPTED SOLUTION

Accepted Solutions
jstern1 Frequent Visitor
Frequent Visitor

Re: Filter Costs by Region, or Update Query Data with Proper Costs Column

Actually I think I figured it out.

 

Just needed to click the add column tab in the query editor. Then create a new conditional column.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Filter Costs by Region, or Update Query Data with Proper Costs Column

Hi @jstern1 ,

 

I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

Please read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,

Amy

 

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

 

Highlighted
jstern1 Frequent Visitor
Frequent Visitor

Re: Filter Costs by Region, or Update Query Data with Proper Costs Column

Thanks for the post link.

 

To clarify, i'd like to have a new column that maps the appropriate cost based on region for each row. 

 

As in,

 

            Region | Cost

Row 1 |        US | $1

Row 2 |        AP | $3

Row 3 |        EU | $2

 

Since i do not have the data structured in that way at the moment. 

 

Thanks!

jstern1 Frequent Visitor
Frequent Visitor

Re: Filter Costs by Region, or Update Query Data with Proper Costs Column

Actually I think I figured it out.

 

Just needed to click the add column tab in the query editor. Then create a new conditional column.

View solution in original post

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,280)