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
THENNA_41
Post Partisan
Post Partisan

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 @THENNA_41 ,

 

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 @THENNA_41 ,

 

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.

@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
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.