Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply

Get only one matching month and year of other date column

I have two date column,

one column has month-year and another column is weekend-dates, like below image

newlearnpbi123_0-1702132107017.png

 

 

i want to have only one matching month and year of the month column, like below

newlearnpbi123_1-1702132107020.png

 

 

the issue is starting of month and end of month sometimes present in previous month as highlighted in first image,

can someone help me get the result of 2nd image, any date is fine as long it is only one date matching the month column, so i could use it in  my slicer.

2 ACCEPTED SOLUTIONS
saurabhtd
Resolver II
Resolver II

@newlearnpbi123  You can create new column like

any date = DATE(YEAR('Calendar'[Month-Year]),MONTH('Calendar'[Month-Year]),1 )

Here we are creating new date column wheere year and month will ba taken from Year-Month column and Day will be 1. So they will be one date for each Month. You can keep Day as any other number between 0-28. 
saurabhtd_1-1702196840032.png

 

View solution in original post

Anonymous
Not applicable

Hi @newlearnpbi123 ,

You can try this way:
Here is my sample date:

vjunyantmsft_0-1702446474371.png

I use these DAXs below to create two new columns to extract year and month:

Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])

vjunyantmsft_1-1702446611960.png

Then I use this DAX to create a new table to achieve your purpose:

Slicer = 
SUMMARIZE(
    'Table',
    'Table'[Year],
    'Table'[Month],
    "slicer",
    MIN('Table'[Date])
)

vjunyantmsft_2-1702446697862.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @newlearnpbi123 ,

You can try this way:
Here is my sample date:

vjunyantmsft_0-1702446474371.png

I use these DAXs below to create two new columns to extract year and month:

Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])

vjunyantmsft_1-1702446611960.png

Then I use this DAX to create a new table to achieve your purpose:

Slicer = 
SUMMARIZE(
    'Table',
    'Table'[Year],
    'Table'[Month],
    "slicer",
    MIN('Table'[Date])
)

vjunyantmsft_2-1702446697862.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



saurabhtd
Resolver II
Resolver II

@newlearnpbi123  You can create new column like

any date = DATE(YEAR('Calendar'[Month-Year]),MONTH('Calendar'[Month-Year]),1 )

Here we are creating new date column wheere year and month will ba taken from Year-Month column and Day will be 1. So they will be one date for each Month. You can keep Day as any other number between 0-28. 
saurabhtd_1-1702196840032.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.