0

I am new in powerBI, I loonking to display data in during a closing period and in my case it is from :

31/12/Y-1 to 31/12/Y my issue it is with slicer the year filter all date in the current year and not taking into account the value in 31/12/Y-1

How can I set PowerBI to do so,

thanks for your support

Display Sum of data in a defined period 31/12/Y-1 till 31/12/Y, user can select the period that they want to display and the data will update via PowerBI

Slicer below :

Date Slicer

Aarcko
  • 11
  • 2

2 Answers2

1

Use this calculated column

Closing Period = 
VAR thisYear = YEAR(TODAY())
VAR startDate = DATE(thisYear -1 , 12, 31)
VAR endDate = DATE(thisYear, 12, 31)
RETURN
    IF(startDate <= 'Date'[Date] && 'Date'[Date] <= endDate, thisYear)

and filter the 'Date'[Closing Period] column on the current year.

enter image description here

Peter
  • 10,959
  • 2
  • 30
  • 47
  • Hello @Peter, thank you for your answer, the problem is that in my database I have to apply this logic for 2020, 2021, 2022 and so on and for the 31/12 there is an overlap between Y-1 and the current year and I don't know how to group the 31/12 for in your example on the one hand for the 2021 period and on the other hand for the 2022 period – Aarcko Dec 13 '22 at 06:15
0

You can use a new calculated column for the slicer in your case:

Filter_date = DATEADD ( 'Date Table'[date].[Date], +1, DAY )
Kevin
  • 432
  • 1
  • 2
  • 10