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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

dax formula for last 4 completed weeks

Hi All,

can you all help me to calculate last 4 completed weeks. I am struglling to get this result.

1 ACCEPTED SOLUTION

HI @Anonymous 

 

Sure, please see the attached file.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

5 REPLIES 5
AlB
Super User
Super User

Hi @Anonymous 

Can you show some sample data and be a bit more specific describing what you need? Show an example with the expected result based on that data. Please have a look at these tips for getting your question answered quickly. 

Anonymous
Not applicable

Hi 

I want to show differece quantity between last 4 completed weeks to Previous 4 weeks cpmpleted. see the attached excel.

we have only two column date and quantity. 

 

DateQtyLast 4 WeeksPrevious 4 Weeks
01-01-20192  
02-01-20193  
03-01-20194  
04-01-20192  
05-01-20193  
06-01-20194  
07-01-20193.8  
08-01-20194.028571  
09-01-20194.257143  
10-01-20194.485714  
11-01-20194.714286  
12-01-20194.942857  
13-01-20195.171429  
14-01-20195.4  
15-01-20195.628571  
16-01-20195.857143  
17-01-20196.085714  
18-01-20196.314286  
19-01-20196.542857  
20-01-20196.771429  
21-01-20197  
22-01-20197.228571  
23-01-20197.457143  
24-01-20197.685714  
25-01-20197.914286  
26-01-20198.142857  
27-01-20198.371429  
28-01-20198.6  
29-01-20198.828571  
30-01-20199.057143  
31-01-20199.285714  
01-02-20199.514286  
02-02-20199.742857  
03-02-20199.971429  
04-02-201910.2  
05-02-201910.42857  
06-02-201910.65714  
07-02-201910.88571  
08-02-201911.11429  
09-02-201911.34286  
10-02-201911.57143  
11-02-201911.8  
12-02-201912.02857  
13-02-201912.25714  
14-02-201912.48571  
15-02-201912.71429  
16-02-201912.94286  
17-02-201913.17143  
18-02-201913.4  
19-02-201913.62857  
20-02-201913.85714  
21-02-201914.08571  
22-02-201914.31429  
23-02-201914.54286  
24-02-201914.77143  
25-02-201915  
26-02-201915.22857  
27-02-201915.45714  
28-02-201915.68571  
01-03-201915.91429  
02-03-201916.14286  
03-03-201916.37143  
04-03-201916.6  
05-03-201916.82857  
06-03-201917.05714  
07-03-201917.28571  
08-03-201917.51429  
09-03-201917.74286  
10-03-201917.97143  
11-03-201918.2  
12-03-201918.42857  
13-03-201918.65714  
14-03-201918.88571  
15-03-201919.11429  
16-03-201919.34286  
17-03-201919.57143  
18-03-201919.8  
19-03-201920.02857  
20-03-201920.25714  
21-03-201920.48571  
22-03-201920.71429  
23-03-201920.94286  
24-03-201921.17143  
25-03-201921.4  
26-03-201921.62857  
27-03-201921.85714  
28-03-201922.08571  
29-03-201922.31429  
30-03-201922.54286  
31-03-201922.77143  
01-04-201923  
02-04-201923.22857  
03-04-201923.45714  
04-04-201923.68571  
05-04-201923.91429  
06-04-201924.14286  
07-04-201924.37143  
08-04-201924.6  
09-04-201924.82857  
10-04-201925.05714  
11-04-201925.28571  
12-04-201925.51429  
13-04-201925.74286  
14-04-201925.97143  
15-04-201926.2  
16-04-201926.42857  
17-04-201926.65714  
18-04-201926.88571  
19-04-201927.11429  
20-04-201927.34286  
21-04-201927.57143  
22-04-201927.8  
23-04-201928.02857  
24-04-201928.25714  
25-04-201928.48571  
26-04-201928.71429  
27-04-201928.94286  
28-04-201929.17143  
29-04-201929.4  
30-04-201929.62857  
01-05-201929.85714  
02-05-201930.08571  
03-05-201930.31429  
04-05-201930.54286  
05-05-201930.77143  
06-05-201931  
07-05-201931.22857  
08-05-201931.45714  
09-05-201931.68571  
10-05-201931.91429  
11-05-201932.14286  
12-05-201932.37143  
13-05-201932.6  
14-05-201932.82857  
15-05-201933.05714  
16-05-201933.28571  
17-05-201933.51429  
18-05-201933.74286  
19-05-201933.97143  
20-05-201934.2  
21-05-201934.42857  
22-05-201934.65714  
23-05-201934.88571  
24-05-201935.11429  
25-05-201935.34286  
26-05-201935.57143  
27-05-201935.8  
28-05-201936.02857  
29-05-201936.25714  
30-05-201936.48571  
31-05-201936.71429  
01-06-201936.94286  
02-06-201937.17143  
03-06-201937.4  
04-06-201937.62857  
05-06-201937.85714  
06-06-201938.08571  
07-06-201938.31429  
08-06-201938.54286  
09-06-201938.77143  
10-06-201939  
11-06-201939.22857  
12-06-201939.45714  
13-06-201939.68571  
14-06-201939.91429  
15-06-201940.14286  
16-06-201940.37143  
17-06-201940.6  
18-06-201940.82857  
19-06-201941.05714  
20-06-201941.28571  
21-06-201941.51429  
22-06-201941.74286  
23-06-201941.97143  
24-06-201942.2  
25-06-201942.42857  
26-06-201942.65714  
27-06-201942.88571  
28-06-201943.11429  
29-06-201943.34286  
30-06-201943.57143  
01-07-201943.8  
02-07-201944.02857  
03-07-201944.25714  
04-07-201944.48571  
05-07-201944.71429  
06-07-201944.94286  
07-07-201945.17143 TRUE
08-07-201945.4 TRUE
09-07-201945.62857 TRUE
10-07-201945.85714 TRUE
11-07-201946.08571 TRUE
12-07-201946.31429 TRUE
13-07-201946.54286 TRUE
14-07-201946.77143 TRUE
15-07-201947 TRUE
16-07-201947.22857 TRUE
17-07-201947.45714 TRUE
18-07-201947.68571 TRUE
19-07-201947.91429 TRUE
20-07-201948.14286 TRUE
21-07-201948.37143 TRUE
22-07-201948.6 TRUE
23-07-201948.82857 TRUE
24-07-201949.05714 TRUE
25-07-201949.28571 TRUE
26-07-201949.51429 TRUE
27-07-201949.74286 TRUE
28-07-201949.97143 TRUE
29-07-201950.2 TRUE
30-07-201950.42857 TRUE
31-07-201950.65714 TRUE
01-08-201950.88571 TRUE
02-08-201951.11429 TRUE
03-08-201951.34286 TRUE
04-08-201951.57143TRUE 
05-08-201951.8TRUE 
06-08-201952.02857TRUE 
07-08-201952.25714TRUE 
08-08-201952.48571TRUE 
09-08-201952.71429TRUE 
10-08-201952.94286TRUE 
11-08-201953.17143TRUE 
12-08-201953.4TRUE 
13-08-201953.62857TRUE 
14-08-201953.85714TRUE 
15-08-201954.08571TRUE 
16-08-201954.31429TRUE 
17-08-201954.54286TRUE 
18-08-201954.77143TRUE 
19-08-201955TRUE 
20-08-201955.22857TRUE 
21-08-201955.45714TRUE 
22-08-201955.68571TRUE 
23-08-201955.91429TRUE 
24-08-201956.14286TRUE 
25-08-201956.37143TRUE 
26-08-201956.6TRUE 
27-08-201956.82857TRUE 
28-08-201957.05714TRUE 
29-08-201957.28571TRUE 
30-08-201957.51429TRUE 
31-08-201957.74286TRUE 
01-09-201957.97143  
02-09-201958.2  
03-09-201958.42857  
04-09-201958.65714  

Hi @Anonymous 

 

The below blog post should help you to achieve your requirement.

https://community.powerbi.com/t5/Community-Blog/Relative-Date-Dimension/ba-p/779039,

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Anonymous
Not applicable

Hi @Mariusz ,

 

Not finding exact solution, do you have dax formula for last 4 completed weeks.

HI @Anonymous 

 

Sure, please see the attached file.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.