Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the table name called Inventory sheet . this table sample data looks like below
Version Attribute Value Weekstartdate
pods Demand 10 15 March 2021
pods DOI 20 14 November 2021
pods Demand 50 22 March 2021
pods DOI 40 21 November 2021
pods Demand 30 29 March 2021
pods Demand 50 05 April 2021
pods Demand 60 12 April 2021
pods DOI 10 28 November 2021
pods Demand 90 19 April 2021
pods Demand 10 26 April 2021
I am trying to get demand value from selected date to next three Months. i have tired below measures
But iam not getting correct value . also attached pbi fILE ALSO
Sample File : Sample Power bi
Thanks in advance .
Solved! Go to Solution.
Hi @Anonymous ,
1.Please to create a successive date table by “Append” table, and create a model
Calendar =
CALENDAR (
FIRSTDATE ( 'Append'[Weekstartdate] ),
LASTDATE ( 'Append'[Weekstartdate] )
)
2.Create two measure
Measure =
VAR cur_date =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM ( 'Append'[Value] ),
DATESINPERIOD ( 'Calendar'[Date], cur_date, 3, MONTH )
)
Measure2 =
VAR cur_ste =
SELECTEDVALUE ( 'Append'[Attribute] )
RETURN
IF (
cur_ste = "Demand",
CALCULATE ( [Measure], 'Append'[Attribute] = "Demand" )
)
Add a table visual:
Please refer attached .pbix file
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
1.Please to create a successive date table by “Append” table, and create a model
Calendar =
CALENDAR (
FIRSTDATE ( 'Append'[Weekstartdate] ),
LASTDATE ( 'Append'[Weekstartdate] )
)
2.Create two measure
Measure =
VAR cur_date =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM ( 'Append'[Value] ),
DATESINPERIOD ( 'Calendar'[Date], cur_date, 3, MONTH )
)
Measure2 =
VAR cur_ste =
SELECTEDVALUE ( 'Append'[Attribute] )
RETURN
IF (
cur_ste = "Demand",
CALCULATE ( [Measure], 'Append'[Attribute] = "Demand" )
)
Add a table visual:
Please refer attached .pbix file
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Thank you so much its working
@amitchandak sir I have created Date table and also created new measure but values not getting correctly . please find the created measure below
@Anonymous , Please use date table and try
example
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),3,MONTH))
and why there is no demand filter in the second measure
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |