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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Selected Week from Next 4 week value calculation

I have table name called Invenoty sheet . this table look like . i want filter it only Demand Attribute value . if Demand attribute value if date 15 March  2021 select from that date to Next week  value  Need to get it for 15 March 2021.

 

I am Used below Measure 

Mesaure  = CALCULATE(sum(Append1[Value]),FILTER(Append1,Append1[Attributes]="Demand"),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),1,MONTH))  

 

( 4  week Consider as 1 week ) 

INPUT:

 

DATE                           ATTRIBUTE                         value                      

15 March 2021            Demand                               45

15 March 2021            DOI                                      25

22 March 2021           Demand                                55

22 March 2021            DOI                                      35

29 March 2021            Demand                               65

29 March 2021            DOI                                       85

05 April   2021            Demand                               45

05 April   2021            DOI                                       85

12 April  2021           Demand                                  95

12 April  2021              DOI                                     65

19 April  2021            Demand                               45

19 April  2021            DOI                                      35

26 April  2021            Demand                               45

26 April  2021            DOI                                      65

 

 

Expected Output : 

 

DATE                           ATTRIBUTE                         value           Selected week from Next 4 week

15 March 2021            Demand                              15                         120                                             =>    15+25+35+45

22 March 2021           Demand                               25                         170                                             =>   25+35+45+55

29 March 2021            Demand                              35                         190                                             =>  35+45+55+65

05 April   2021            Demand                              45                          210                                            =>45+55+65+45

------

----

----------

31 December 2022   Demand                               88

 

Looking for support .. thanks in advance .,

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

Hi @Anonymous ,

 

1.Please create a new table like below using following DAX:

Table = FILTER('Append1','Append1'[ATTRIBUTE]="Demand")

vyadongfmsft_0-1659605970713.png

 

2.Create a measure called Selected week from Next 4 week:

Selected week from Next 4 week = SUMX(
    DATESINPERIOD('Table'[DATE],MIN('Table'[DATE]),28,DAY),
    CALCULATE(SUM('Table'[VALUE]))
)

 

3.In report page, please create a table visual, then you can see the total data for the last four weeks.

210 = 45+55+65+45

260 = 55+65+45+95

250 = 65+45+95+45

……

vyadongfmsft_2-1659605970715.png

Best Regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.Please create a new table like below using following DAX:

Table = FILTER('Append1','Append1'[ATTRIBUTE]="Demand")

vyadongfmsft_0-1659605970713.png

 

2.Create a measure called Selected week from Next 4 week:

Selected week from Next 4 week = SUMX(
    DATESINPERIOD('Table'[DATE],MIN('Table'[DATE]),28,DAY),
    CALCULATE(SUM('Table'[VALUE]))
)

 

3.In report page, please create a table visual, then you can see the total data for the last four weeks.

210 = 45+55+65+45

260 = 55+65+45+95

250 = 65+45+95+45

……

vyadongfmsft_2-1659605970715.png

Best Regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-yadongf-msft   tank you its working. is there any possible to show Week Wise ..

 

My data set looks like a below 

 

THENNA_41_0-1671163262117.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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