Forum Discussion
iiomarioii
Helper II
6 years agoSplit monthly values to daily values
Hi guys, this my problem: I got the following table: Month Value May 300 June 600 ... ... I would like to divide the value of the month equally on every day, so for e...
- 6 years ago
Then this scenario will be much more complicated because the date needs to mutiply the product number.
my solution is a little complicated.
1. add month column into your datetime table
2. Then create a new table
new table = VAR TBL1=ADDCOLUMNS(SUMMARIZE(DATETIME,DATETIME[Date]),"_month",MAXX(FILTER('DATETIME','DATETIME'[Date]=EARLIER(DATETIME[Date])),'DATETIME'[Month])) VAR TBL2=ADDCOLUMNS(SUMMARIZE('Table','Table'[Item],'Table'[Month],'Table'[VALUE]),"_month",MAXX(FILTER('Table','Table'[Month]=EARLIER('Table'[Month])),'Table'[Month])) RETURN NATURALLEFTOUTERJOIN(TBL1,TBL2)3. create a new column in the new table.
average = var day= CALCULATE(DISTINCTCOUNT('new table'[Date]),FILTER('new table','new table'[_month]=EARLIER('new table'[_month]))) return 'new table'[VALUE]/dayI am not sure if this is the best solution for you. Let's see if anyone else can provide a better one.
Hope this is helpful.
iiomarioii
Helper II
6 years ago
Hi Ryan,
my date format is long month + year in the value table (e.g. June 2020). My "Month" column that I ve created in my date table has the same date format. (mmm YYYY)
Thank you
iiomarioii
iiomarioii
Helper II
6 years agoI ve deleted everything and started from the beginning. Now it works!!
Thank you very much Ryan!
You have been great help!
Best regards
iiomarioii