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.
Dear all,
I am looking for a way to sum demand of the next month (rolling).
Regarding the data set I do only have monthly data that is displayed with the first day of the month (01.MM.YYYY)
I did try an approach with the NEXTMONTH function:
Sum Demand next month = CALCULATE (SUM('Input'[Total Demand Quantity]); NEXTMONTH('Stock Cover_Input'[Date]))
However this did not work.
So overall it should like this, but in the column "Sum demand next month" the sum of demand of the next month should be shown.
Do you have any idea how to make this work?
Thank you very much in advance!
Solved! Go to Solution.
Hi,
Try this
1. Setup a relationship between Dummy[Date] and Date[Date]. Currently the relationship was setup incorrectly
2. Edit your [Sum Demand Next Month] measure and use the following code = CALCULATE(SUM(Dummy[Total Demand]),DATEADD('Date'[Date],1,MONTH))
3. Use Dates in the table rather than cal year/ month
Now the table should work. A snapshot
Take a look at the pbix attached
Give this a shot please
Sum Demand next month = VAR mydate = EOMONTH ( SELECTEDVALUE ( 'Stock Cover_Input'[Date] ), 0 ) + 1 RETURN CALCULATE ( SUM ( 'Input'[Total Demand Quantity] ), 'Stock Cover_Input'[Date] = mydate )
Hey @Zubair_Muhammad, it did not work either unfortunately...only a blank column as a result 😕
Hi @ce2016,
Please create a calendar table (with continuous dates that cover your whole period) and then link it to your data model.
Then use your formula, it should work.
I made a test and it worked on my side.
Ninter.
Hi @Interkoubess,
I created a Date table, following the instructions of this webpage:
Then I linked the Date table with my main data table via date as key (1:*-relationship).
However, this also does not seem to work..
Data rows are always dated on the first of a month, does it have to do something with that eventually?
Thanks!
Hi Ninter @Interkoubess,
Thank you so much for your help.
I uploaded a dummy file on a dropbox folder:
https://www.dropbox.com/s/zcxlult57kwgfle/Dummy%20Sum%20Demand%20Nxt%20Month.pbix?dl=0
Thanks again for your support!
Hi,
Try this
1. Setup a relationship between Dummy[Date] and Date[Date]. Currently the relationship was setup incorrectly
2. Edit your [Sum Demand Next Month] measure and use the following code = CALCULATE(SUM(Dummy[Total Demand]),DATEADD('Date'[Date],1,MONTH))
3. Use Dates in the table rather than cal year/ month
Now the table should work. A snapshot
Take a look at the pbix attached
Works! Thank you guys!
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |