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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors