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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
wouter_v
New Member

Calculate sales target per month combination of 2 different stores in 1

Hi all,

 

Hope you can help out.

 

I am trying to generate sales targets for our newly opened store last year August.

The sales target for this store needs to be a combination of the sales from another store for the months 1-7 of 2021 and sales from the new store month 8-12 of 2021.

 

I have data like in the below table. What I would like to have in a list is Sales target for store 2

 

datestoresales
jan-21store1 655000
feb-21store1 145000
mrt-21store1 255222
apr-21store1 365653
mei-21store1 756241
jun-21store1 655000
jul-21store1 145000
aug-21store2 255222
sep-21store2 365653
okt-21store2 756241
nov-21store2 255222
dec-21store2 365653

 

 

 

I've been trying to use below DAX code, but with the contains function, all stores get filtered out except store 2.

Order omzet YTD = TOTALYTD([Order omzet totaal],Kalender[Datum])

 

IF(

CONTAINS(FilialenTabel,FilialenTabel[Fil.code],"store2"),

 

CALCULATE([Order omzet YTD], Kalender[Maand] IN { 1,2,3,4 },Kalender[Jaar] IN { 2020 }, FilialenTabel[Fil.code]="store1") +(

CALCULATE(

[Order omzet YTD],

Kalender[Maand] IN { 5,6,7 },Kalender[Jaar] IN { 2021 }, FilialenTabel[Fil.code] ="store1")*1.10)

+(

CALCULATE(

[Order omzet YTD],

Kalender[Maand] IN { 8,9,10,11,12 },Kalender[Jaar] IN { 2021 }, FilialenTabel[Fil.code] ="store2")*1.10)

,

CALCULATE([Order omzet YTD], Kalender[Maand] IN { 1,2,3,4 },Kalender[Jaar] IN { 2020 })+(

CALCULATE(

[Order omzet YTD],

Kalender[Maand] IN { 5,6,7,8,9,10,11,12 },Kalender[Jaar] IN { 2021 })*1.10)

 

)

 

Hope someone can help. Thanks in advance.

2 REPLIES 2
Anonymous
Not applicable

Hi @wouter_v ,

 

I have checked your code, and I think you seems to calculate the TotalYTD based on some calculation logic. 

Is "FilialenTabel" the table your provided above? Is [Fil.code] = [Store] as above? I am confused about why you will use value in 2020/1/2/3/4 in your code.

Could you share a sample file with us and show us a screenshot with the result you want? This will make me easier to find the solution.

 

Best Regards,
Rico Zhou

 

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

johnt75
Super User
Super User

You could try creating a new table using

Target store 2 = UNION(
CALCULATETABLE( 'Table', 'Table'[store] = "store 1", DATESBETWEEN('Date'[Date], DATE(2021,1,1), DATE(2021,7,31))),
CALCULATETABLE( 'Table', 'Table'[store] = "store 2", DATESBETWEEN('Date'[Date], DATE(2021,8,1), DATE(2021,12,31)))
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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