Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all! I need some help here...
I´m trying to create a table with sales forecast per store, based on last days in this week / month / period of time.
I would like to create a table with stores in the rows, and date in the columns.
For each date (if less than today), I must put the actual sales value. If the date is later, the field must be completed with the average of the last days of the table (yellow marks in the table below). For security reasons, I can not put the true values...
How can I do this?
Best regards,
Lucas
Solved! Go to Solution.
Hi @Anonymous ,
Refer to the sample.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try like
new column =
var _olddate = maxx(filter('Table','Table'[store] = earlier( 'Table'[store]) && 'Table'[Date] < earlier( 'Table'[Date])), 'Table'[Date])
return
AvergaeX(filter('Table','Table'[store] = earlier( 'Table'[store]) && 'Table'[Date] =_olddate ),'Table'[sales])
@Anonymous - I would unpivot your week columns and then you can use EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |