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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Evanooruvan
Helper II
Helper II

How to 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

Evanooruvan_0-1702133018126.png

 

 

 

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

Evanooruvan_1-1702133017858.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.

 

@grey  @FreemanZ @Jihwan_Kim  any help please. thank you

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Evanooruvan 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1702359841988.png

Create a measure

Measure =
VAR a =
    MINX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            EOMONTH ( [wk_end_dt], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 )
        ),
        [wk_end_dt]
    )
RETURN
    IF ( MAX ( 'Table'[wk_end_dt] ) = a, 1, 0 )

Then put it to the visual filter.

vxinruzhumsft_1-1702359948183.png

Output

vxinruzhumsft_2-1702359960817.png

Best Regards!

Yolo Zhu

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-xinruzhu-msft
Community Support
Community Support

Hi @Evanooruvan 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1702359841988.png

Create a measure

Measure =
VAR a =
    MINX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            EOMONTH ( [wk_end_dt], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 )
        ),
        [wk_end_dt]
    )
RETURN
    IF ( MAX ( 'Table'[wk_end_dt] ) = a, 1, 0 )

Then put it to the visual filter.

vxinruzhumsft_1-1702359948183.png

Output

vxinruzhumsft_2-1702359960817.png

Best Regards!

Yolo Zhu

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

Ritaf1983
Super User
Super User

Hi @Evanooruvan 
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.