DAX Calculation CPG

Hi Guys,

I have a CPG dataset where it has information about the promotions and all of that. Which product is being promoted in what type and in which week and all those.
I want to find out how many weeks a product was on promotion. Can you guys help me with this. Its pretty urgent. I have the dates where the particular product is being promoted and where is it being promoted. So now i want the count of weeks it was on promotion.

Thanks & Regards,
Hari

1 Like

Hi @HariGanesan. Please upload a work-in-progress PBIX file (using sample data, if necessary) and a mock-up in Excel of exactly what youā€™re trying to achieve to aid the forum membersā€™ investigations of your issue.
Greg

1 Like

Hi Greg,

Please find the attached sample file.
So lets say in column brand i have two products. I want to find out how many weeks that specific product was on promotion.
sample_data.xlsx (9.8 KB)
Kindly help me in this regard.

Thanks in advacne

Hi @HariGanesan.

Based on the sample data you provided I think the DATEDIFF function might help solve the problem. You can create a measure that looks something like this:

Weeks on Promotion =
DATEDIFF(
SELECTEDVALUE(ā€˜Table Nameā€™[Week Starting] ),
SELECTEDVALUE(ā€˜Table Nameā€™[Week ending] ),
WEEK
)

Hi @HariGanesan,

Just checking if the response from @BolajiO help you solve your inquiry?

If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.

1 Like

Hi @HariGanesan, due to inactivity, a response on this post has been tagged as ā€œSolutionā€. If you have any concern related to this topic, you can create a new thread.