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
NL-Nicolas
Helper I
Helper I

NetSales by a date in Column

Hey all!

 

I have a calculated column here:
Last Week = CALCULATE(sum(DayfileSummary[DF_BusinessDay]), FILTER(ALL(DayfileSummary[DF_BusinessDay]),DayfileSummary[DF_BusinessDay]=max(DayfileSummary[DF_BusinessDay])-366))
and when I go to attach it to my field DayfileSummary[NetSales] it will not filter in anyway.

 

My end goal is to filter the number in each row for the column NetSales by the date in the column DayfileSummary[Last Week]

It is a Year over Year change analyisis for the same day one year ago. In this case Last week is finding their last day on the same fiscal calendar. When I try quick calculate, I cannot use 

4 REPLIES 4
NL-Nicolas
Helper I
Helper I

Update: My column with a date is a measured column. It seems it cannot be used however and my Data has been imported from SQL I feel like I have hit a wall on Power Bi functions here on accident. Help!

v-rzhou-msft
Community Support
Community Support

Hi @NL-Nicolas ,

 

I think you can try code as below to catch the same day one year ago based on [Last Week].

DATE(YEAR(MAX('DayfileSummary'[Last Week])-1 ),MONTH(MAX('DayfileSummary'[Last Week]) ),DAY(MAX('DayfileSummary'[Last Week])))

Please share a sample file without sensitive data with me. This will make it easier for me 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.

NLNicolas_0-1659116575913.png

Here is the error I received from that. I also tried 

Last Week Sales = COUNTX(filter(DayfileSummary, DayfileSummary[NetSales]),DayfileSummary[Last Week])
But it returns nothing! Really stumped on this one

Hey RicoZhou!

 

Thanks for the response, it turns out my client's DataImport was only 4 months of data! So even if I have been getting the formula right this whole time there was no data to show! I will get back to this post soon after my call today to import the data. I appreciate you trying to help!

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.