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
dyttam
Regular Visitor

Week over Week % using a WEEKEND Date column instead of DATE column

Hello, 

I am looking to calculate Week over Week % using the following measure: 


Capture1.JPG

 


 





I think the issue is with the WEEKEND column I am using as the Date reference.

The WEEKEND column is taking calendar days and grouping them into weeks. Which is fine.

The problem, I think, comes at the MIN ('dwh SCFinance_Weekly_WIP'[WEEKEND]) - 1) part of my measure. 

I cannot explain why the result is showing 0.00%, no matter what WEEKEND I select in my slicer. 

I've attached a visual  that might be helpful. 
Capture.JPG
1 ACCEPTED SOLUTION

Hi @dyttam , try changing your MIN ('dwh SCFinance_Weekly_WIP'[WEEKEND]) - 1) to MIN ('dwh SCFinance_Weekly_WIP'[WEEKEND]) - 7) since the WEEKEND column is of date type.

 

Otherwise, you can also use a week number column instead and then it will be something like MIN ('dwh SCFinance_Weekly_WIP'[WEEKNUM]) - 1) to get the previous week's value. Reference: https://community.powerbi.com/t5/Desktop/Change-this-week-over-last-week/m-p/1377285#M587828

 

View solution in original post

3 REPLIES 3
dyttam
Regular Visitor

I added in an IF statement that would return "N/A" if the VAR "LastWeekValue" = 0. 

It looks like I am correct that the error is in the Filtering part of the DAX as all entries showed up as N/A. 

 

Capture2.JPGCapture3.JPG

Hi @dyttam , try changing your MIN ('dwh SCFinance_Weekly_WIP'[WEEKEND]) - 1) to MIN ('dwh SCFinance_Weekly_WIP'[WEEKEND]) - 7) since the WEEKEND column is of date type.

 

Otherwise, you can also use a week number column instead and then it will be something like MIN ('dwh SCFinance_Weekly_WIP'[WEEKNUM]) - 1) to get the previous week's value. Reference: https://community.powerbi.com/t5/Desktop/Change-this-week-over-last-week/m-p/1377285#M587828

 

Hi @dyttam ,

 

What is the value of min(table[weekend]) -1, pretty sure it will not be last week value, likely will be the day before. Once you get the correct weekend value i would imagine it will work properly. If you are able to share either the PBIX or some sample data that would be helpful.

 

Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

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

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.