Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
WillEyedowin
Frequent Visitor

WEEKNUM Relative Date Filtering

Hello All,

 

I would like to filter my entire report to include all dates(weeknum's) up until the week before current.

 

E.g. I want my report to include WEEKNUMS 1 through 45 but not week 46 if that was our current week.

 

I have various graphs which need to report what has sold versus what has been dispatched for the weeks prior to this week.

 

The reason for weeks is that is the best way to group the data.

 

Information which may be helpful:

The sold table's Sold Date includes the latest date(& weeknum) which should be used in the report.

 

Ideally would like it to not be hardcoded and would filter the whole report based on the latest date which something sold.

 

Or just based on the NOW() time and go back one week as the report will only be relevant for that week until new data is imported.

 

This is only my second post here so please let me know if you need any more information to help me out.

 

Thank you Smiley Happy

 

 

Relationships.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

For example - I would like this to exclude those last 100%'s by only using the weeknum with sales dataFor example - I would like this to exclude those last 100%'s by only using the weeknum with sales data

 

 

1 ACCEPTED SOLUTION

Hi,

 

Does this measure work?

 

Measure = if(ISBLANK(SUM(sold[Quantity Sold])),BLANK(),1-DIVIDE(SUMX(RELATEDTABLE('sold'),[Quantity Sold]),SUMX(RELATEDTABLE('Dispatched'),[Quantity Delivered]),0))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

Appreciate the offer - However, unfortunately, there is some sensitive data in the report.

 

Is there an easy way to anonymize/de-sensitize or limit your access to this data?

 

Further, how would you recommend I upload the file for you to download it? 

Hi,

 

Create a dummy dataset and upload the file to Google Drive or any such similar service.  Share the download link.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

I get the "Access denied" message when i click on that link.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

I changed the link to private last night as I assumed you would have already downloaded it - public again now 🙂 

Hi,

 

In the Stores Table, there is no Date column.  There should be a Date column there which should connect to the dateKey Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

The Stores table is just a list of supermarkets - I don't believe a date column would work as a store does not have a date?

Hi,

 

Does this measure work?

 

Measure = if(ISBLANK(SUM(sold[Quantity Sold])),BLANK(),1-DIVIDE(SUMX(RELATEDTABLE('sold'),[Quantity Sold]),SUMX(RELATEDTABLE('Dispatched'),[Quantity Delivered]),0))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

Yes, that works! So just to make sure I understand the DAX:

 

This checks if the quantity sold sum is blank - if so then then use blank as the data, otherwise use the correct data and graph it?

Good to know that.  Yes, that is correct. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.