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
Anonymous
Not applicable

Inputs by customer tracking

I have a database like this to record when a customer sends us an item.

DOC_NO       ACCTNO       ENTER_DATE      QTY

123                15423           2017-04-17         1

124                10184           2017-04-17          1

.....

 

I have date dimensions table that I've linked the enter_date to.

 

What is the easiest way to track inputs variances, by a customer, for 30 days, 60 days and 90-day periods?

 

I need information like this: Customer 15423 has sent me 12 less units over the last 30 days compared to the 30 days prior.  I would like to have a slicer were I can select 30 day, 60 day, 90 day.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

You can refer to below steps to calculate with selected day range.

 

1. Create a table to store the day range.

 

Selector Range = UNION(ROW("Range",30),ROW("Range",60),ROW("Range",90))

 

 

2. Add a measure to get the chose item from "Selector Range" table.

3. Create a slicer with "range" column of "Selector Range" table.

4. Add a measure to calculate on chosen item.

 

Calculate Range = 
var currDate=MAX(test[ENTER_DATE])
return
SUMX(FILTER(ALL(test),[ACCTNO]=MAX([ACCTNO])&&[ENTER_DATE]>=DATE(YEAR(currDate),MONTH(currDate),DAY(currDate)-[Selected Item])&&[ENTER_DATE]<=currDate),[QTY])

5. Drag a table visual to store the result.

 

Capture.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

You can refer to below steps to calculate with selected day range.

 

1. Create a table to store the day range.

 

Selector Range = UNION(ROW("Range",30),ROW("Range",60),ROW("Range",90))

 

 

2. Add a measure to get the chose item from "Selector Range" table.

3. Create a slicer with "range" column of "Selector Range" table.

4. Add a measure to calculate on chosen item.

 

Calculate Range = 
var currDate=MAX(test[ENTER_DATE])
return
SUMX(FILTER(ALL(test),[ACCTNO]=MAX([ACCTNO])&&[ENTER_DATE]>=DATE(YEAR(currDate),MONTH(currDate),DAY(currDate)-[Selected Item])&&[ENTER_DATE]<=currDate),[QTY])

5. Drag a table visual to store the result.

 

Capture.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.