Forum Discussion
Sales against same category but for different time frames
Hi
I have a sales table A wherein I have daily sales for all the brands.
I have another table B wherein I have Brands listed with a different launch and end dates.
I want sales info in table B, but within that specified data range (i.e. sales between launch & end date only) in different rows.
How can I do that in PowerBI?
Thanks
Abhishek
Hi abhishek_tlc ,
Please refer to the calculated column:
Column = CALCULATE(SUM(TableA[Sales]),FILTER(TableA,TableA[Date]<=EARLIER(TableB[End Date]) && TableA[Date] >= EARLIER(TableB[Launch Date]) && TableA[Brand ID] = EARLIER(TableB[Brand ID])))If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
2 Replies
- amitchandak
Super User
abhishek_tlc , new column in Table b
sumx(Filter(TableA, TableA[Brand ID] =TableA[Brand ID] && TableA[Date] >=TableA[Lunch Date] && TableA[Date] <=TableA[end Date]),TableA[Sales] ) - v-deddai1-msft
Community Support
Hi abhishek_tlc ,
Please refer to the calculated column:
Column = CALCULATE(SUM(TableA[Sales]),FILTER(TableA,TableA[Date]<=EARLIER(TableB[End Date]) && TableA[Date] >= EARLIER(TableB[Launch Date]) && TableA[Brand ID] = EARLIER(TableB[Brand ID])))If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai