powerbidaxpowerbi-desktopforecastingforecast

Power BI :: How to create a forecast in DAX


**GOAL: **I want to create a forecast of the month based on the last 3 months.

I found this documentation which looks easy.

Unfortunately when I try to put it in place on my side even the very first calculated measure is not working:

CostsBack1M = CALCULATE(SELECTEDVALUE('Usage details'[costInBillingCurrency]), DATEADD('Usage details'[date].[Date], -1, MONTH))

Note how I used SELECTEDVALUE('Usage details'[costInBillingCurrency]) because I needed to port that column form another table.

I hope using SELECTEDVALUE is the right way to do it. There was no other option, the autocomplete was not working.

Also the date is coming form another table.

I want to put all the Measures to a dedicated table:

enter image description here

I don't know what is wrong here.

the calculation from the documentation looks quite straight forward but when I put it into a card or a line chart everything is blank.

And there are no errors. Why?


Solution

  • Simply replace SELECTEDVALUE with SUM.