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

How to find the states and regions that have achieved their current year sales targets

I have a sales order table with the Order ID, Order Date, Year, Regio, State, Sales Amount, Quantity, Discount, and etc.

R_S13697_0-1669825640605.png

I have another table with the sales target for a given state, in a year and month.

R_S13697_2-1669829730801.png

 

How to find the states(Highlight) that have achieved their sales target?

Thank you. Any help would be appreciated.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

Table1:

vzhangti_0-1669881058111.png

Table2:

vzhangti_1-1669881079343.png

Column:

Order Month = MONTH([Order Date])
Sales Sum = CALCULATE(SUM(Table1[Sales Amount]),
       ALLEXCEPT(Table1,Table1[Year],Table1[Order Month],Table1[Postal Code]))
Target = LOOKUPVALUE(Table2[Target],
                    Table2[Year],[Year],
                    Table2[Month],[Order Month],
                    Table2[State],[Postal Code])
Result = IF([Sales Sum]>=[Target],1,0)

vzhangti_2-1669881191391.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

Table1:

vzhangti_0-1669881058111.png

Table2:

vzhangti_1-1669881079343.png

Column:

Order Month = MONTH([Order Date])
Sales Sum = CALCULATE(SUM(Table1[Sales Amount]),
       ALLEXCEPT(Table1,Table1[Year],Table1[Order Month],Table1[Postal Code]))
Target = LOOKUPVALUE(Table2[Target],
                    Table2[Year],[Year],
                    Table2[Month],[Order Month],
                    Table2[State],[Postal Code])
Result = IF([Sales Sum]>=[Target],1,0)

vzhangti_2-1669881191391.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

ryan_mayu
Super User
Super User

pls share the sample data, not the screenshot. and pls also provide the expected output based on the sample data you provided.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.