Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have table name called Invenoty sheet . this table look like . based on the wknum selection will show rolling average to next 4 weeks .
DATE ATTRIBUTE wknum value
15 March 2021 Demand wk01 45
22 March 2021 Demand wk02 55
29 March 2021 Demand wk03 65
05 April 2021 Demand wk04 45
12 April 2021 Demand wk05 95
19 April 2021 Demand wk06 25
26 April 2021 Demand wk07 35
I am Used below Measure
Expected Output :
wknum ATTRIBUTE value Selected week from Next 4 week
wk01 Demand 45 220 => 55+55+65+45
wk02 Demand 55 260 => 55+65+45+95
wk03 Demand 65 250 => 65+45+95+45
wk04 Demand 45 240 =>45+95+45+55
wk05 Demand 95 195 =>95+45+55
wk06 Demand 45 90 =>45+55
wk07 Demand 55 55 =>55
Looking for support .. thanks in advance .
Solved! Go to Solution.
Hi @Anonymous
You already have a Date table, it is better to use it. Please refer to attached file with the proposed solution
@tamerj1 its working perfectly . one more questions how to convert above measure SUM to average ?
@Anonymous
Just Change SUM to AVERAGE
@tamerj1 its working Now perfectly . I have one more question How to convert above measure SUM to average ?
Hi @Anonymous
If [wknum] column is from the 'Date' table then it should work with a small modification
Mesaure =
CALCULATE (
SUM ( Append1[Value] ),
Append1[Attributes] = "Demand",
DATESINPERIOD ( 'Date'[Date], MIN ( 'Date'[Date] ), 1, MONTH ),
ALLSELECTED ( Append1 )
)
Hi @Anonymous
Please try
Mesaure =
VAR CurrentDate =
CALCULATE (
MIN ( 'Date'[Date] ),
CROSSFILTER ( 'Date'[Date], Append1[Date], BOTH )
)
RETURN
CALCULATE (
SUM ( Append1[Value] ),
Append1[Attributes] = "Demand",
DATESINPERIOD ( 'Date'[Date], CurrentDate, 1, MONTH ),
ALL ( Append1 )
)
@tamerj1 i have tired above measure .. but i am getting CROSSFILTER function can only use the two column references participating in a relationship.
@Anonymous
Which columns are invloved in the relationship? Is there even a relationship between the two tables?
@tamerj1 that issues has been fixed but sum values are showing different . I have attached Power bi file for your reference sir
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |