Forum Discussion

Carlo1975's avatar
Carlo1975
Helper I
5 years ago

Work on Date

Hi I have this table:

 

PortfolioAmountDate
Pippo15001/01/2020
pluto20001/02/2021
Paperino26501/01/2022
Topolino589601/03/2021
Minnie147801/03/2021
Paperone126501/04/2021
Pippo215801/01/2022
pluto26501/08/2022
Paperino589601/06/2020
Topolino147801/10/2021
Minnie15001/08/2021
Paperone20001/09/2021

 

From this table I have to do a MAtrix Table:

1) Only Portfolios and amounts about Current Year (in this case 2021, but next year automatically 2022)

2) I have to show 3 columns about amount: The first with the total about current Year. The second one with the total about the past months (in this case only january) and finally a column with total about next months (from february to december).

The result will be:

 

 TotalActualProject
pluto465200265
Topolino737407374
Minnie162801628
Paperone146501465

 

Is it possible?

2 Replies

  • Carlo1975 , Try with help from time intelligence. Choose Current month in slcier or end you calendar there.

     

    Actual  = CALCULATE(SUM(Table[Amount]),DATESMTD('Date'[Date]))

     

    Total  = CALCULATE(SUM(Table[Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

    or

    Total  = CALCULATE(SUM(Table[Amount]),previousyear('Date'[Date]))

     

    Project = [Total] -[Actual]

     

    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

    • Carlo1975's avatar
      Carlo1975
      Helper I

      Is it possible without using slicer?

      insert instead DATESMTD something like month(today())....