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.
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 @THENNA_41 ,
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 @THENNA_41 ,
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.
@amitchandak sir I have created Date table and also created new measure but values not getting correctly . please find the created measure below
@THENNA_41 , 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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |