Power BI - Get the Days of current Month

Viewed 215

I have a column "Days of Month" which is just rows from 1 to 31 and a filter above with the date as you can see in the screenshot below. I want to filter this column to show me the days of each month based on the filter above. For example if the date above is 2/2/2020 i would like to see 28 rows on my column. I tried several solutions but i couldn't achieve this.

Can anyone help me ?

enter image description here

1 Answers

I was able to get this working by duplicating the date table and creating a relationship to its duplicate on year and month.

  1. Add a [YearMonth] column to your date table

Dates table

  1. Duplicate the Dates table as Dates2

Dates2 table

  1. Create a many-to-many data relationship between Dates and Dates2 on the [YearMonth] column. Set the cross filter direction to Single (Dates filters Dates2)

enter image description here

  1. Set up your report to use a slicer or filter on Dates[Date] and display Date2[Day] in a table visual. Here is the result:

result

Related