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

HOW TO CREATE DAY ON DAY VARIANCE

Hello, I am new to powerbi and I have been struggling to create a day-day week on week variance on particular products. below is snapshot. kindly assist.

 

PowerBi Snapshot.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-qiuyu-msft
Moderator

Re: HOW TO CREATE DAY ON DAY VARIANCE

Hi @olaidaz

 

As your original snapshot doesn't show the product purchase data, I use some sample data to create a desired column: 

 

PercentageDiff = var pre=
CALCULATE(DIVIDE(SUM('Table'[Sales]),CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Product]))),FILTER('Table','Table'[Product]=EARLIER('Table'[Product])&&'Table'[Date]=EARLIER('Table'[Date])-1))
return DIVIDE('Table'[Sales],CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Product])))-pre
 
q4.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Moderator v-qiuyu-msft
Moderator

Re: HOW TO CREATE DAY ON DAY VARIANCE

Hi @olaidaz

 

Would you please clarify the sentence "have been struggling to create a day-day week on week variance on particular products."? 

 

As you already posted a snapshot of your sample data, please tell us your desired result based on the sample data. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
olaidaz Frequent Visitor
Frequent Visitor

Re: HOW TO CREATE DAY ON DAY VARIANCE

Hi v-qiuyu-msft,

 

Thanks for your response. I want to create a new column that will show daily percentage variance as products are purchased daily.

Moderator v-qiuyu-msft
Moderator

Re: HOW TO CREATE DAY ON DAY VARIANCE

Hi @olaidaz

 

As your original snapshot doesn't show the product purchase data, I use some sample data to create a desired column: 

 

PercentageDiff = var pre=
CALCULATE(DIVIDE(SUM('Table'[Sales]),CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Product]))),FILTER('Table','Table'[Product]=EARLIER('Table'[Product])&&'Table'[Date]=EARLIER('Table'[Date])-1))
return DIVIDE('Table'[Sales],CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Product])))-pre
 
q4.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 254 members 2,598 guests
Please welcome our newest community members: