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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
newlearnpbi123
Frequent Visitor

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

v-junyant-msft
Community Support
Community Support

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
v-junyant-msft
Community Support
Community Support

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.