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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
GOLEM
Regular Visitor

The last month of EndofMonth function is replaced by the selected date.

Hi everyone,
I want to do something like this "If I select enddate in date calendar then it will return the last days of each month except the selected month which will return the selected date".Please help me with this!

 

The selected date is 6/6/2025

Image 1 is the current resultProblem.png

 

and image 2 is the result I want to get!

Result.png

 Thank you everyone!

 

2 ACCEPTED SOLUTIONS
Irwan
Super User
Super User

hello @GOLEM 

 

when you choose a selected month, you will only see values from the selected month while the other months will be filtered out.

 

Do you want to get the EndOfMonth when you have chosen month value or when all value are presented (from your screenshot, it looks like all data are presented).

 

Meanwhile, let see if this accomodate your need.

Irwan_0-1749359587550.png

EndofMonth =
IF(
    EOMONTH(SELECTEDVALUE('Table'[Date]),0)=EOMONTH(TODAY(),0),
    SELECTEDVALUE('Table'[Date]),
    EOMONTH(SELECTEDVALUE('Table'[Date]),0)
)

Irwan_2-1749359696478.png

Irwan_1-1749359684550.png

 

 

Thank you.

View solution in original post

danextian
Super User
Super User

Hi @GOLEM 

 

If you want to show the end of month relative to the slicer selection but still show all rows other than the dat selected then you will need to use a disconnected table as using a column from the same or related table in a slicer will show only the rows within the selection

End of Month Date = 
// Get the selected date from the disconnected date table
VAR _SelectedDate =
    SELECTEDVALUE ( DisconnectedDate[Date] )

// Get the end of the month for the selected date from the slicer
VAR _EndOfSelectedMonth =
    EOMONTH ( _SelectedDate, 0 )

// Get the end of the month for the current row context from the Dates table
VAR _EndOfMonthCurrentRow =
    EOMONTH ( SELECTEDVALUE ( Dates[Date] ), 0 )

// If the current row is in the same month as the selected slicer date,
// return the actual date; otherwise, return the end of the current row's month
VAR  _Result = 
    IF (
        _EndOfSelectedMonth = _EndOfMonthCurrentRow,
        SELECTEDVALUE ( Dates[Date] ),
        _EndOfMonthCurrentRow
    )
RETURN
 _Result

 

danextian_0-1749376929301.gif

Pease see the attached pbix for your reference.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
v-mdharahman
Community Support
Community Support

Hi @GOLEM,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you want to select the last date of each month(except the selected month) and its relevant data from your table. As @danextian and @Irwan both responded to your query, please go through their responses and check if your issue can be resolved.

 

I would also take a moment to thank @danextian and @Irwan, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Hi @GOLEM,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If so, it would be really helpful for the community if you could mark the answer that helped you the most. If you're still looking for guidance, feel free to give us an update, we’re here for you!

Hi @GOLEM,
I just wanted to follow up on your thread. If the issue is resolved, it would be great if you could mark the solution so other community members facing similar issues can benefit too.
If not, don’t hesitate to reach out, we’re happy to keep working with you on this. 

 

Best Regards,

Hammad.

Hi @GOLEM,
I wanted to quickly follow up on your issue. Was your issue resolved in the end?
If yes, it’d be great if you could share a quick update and accept a solution, so other users can benefit from your experience too.
If you’re still stuck, let us know, we’re more than happy to continue helping you through it.

 

Best Regards,

Hammad.

danextian
Super User
Super User

Hi @GOLEM 

 

If you want to show the end of month relative to the slicer selection but still show all rows other than the dat selected then you will need to use a disconnected table as using a column from the same or related table in a slicer will show only the rows within the selection

End of Month Date = 
// Get the selected date from the disconnected date table
VAR _SelectedDate =
    SELECTEDVALUE ( DisconnectedDate[Date] )

// Get the end of the month for the selected date from the slicer
VAR _EndOfSelectedMonth =
    EOMONTH ( _SelectedDate, 0 )

// Get the end of the month for the current row context from the Dates table
VAR _EndOfMonthCurrentRow =
    EOMONTH ( SELECTEDVALUE ( Dates[Date] ), 0 )

// If the current row is in the same month as the selected slicer date,
// return the actual date; otherwise, return the end of the current row's month
VAR  _Result = 
    IF (
        _EndOfSelectedMonth = _EndOfMonthCurrentRow,
        SELECTEDVALUE ( Dates[Date] ),
        _EndOfMonthCurrentRow
    )
RETURN
 _Result

 

danextian_0-1749376929301.gif

Pease see the attached pbix for your reference.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Irwan
Super User
Super User

hello @GOLEM 

 

when you choose a selected month, you will only see values from the selected month while the other months will be filtered out.

 

Do you want to get the EndOfMonth when you have chosen month value or when all value are presented (from your screenshot, it looks like all data are presented).

 

Meanwhile, let see if this accomodate your need.

Irwan_0-1749359587550.png

EndofMonth =
IF(
    EOMONTH(SELECTEDVALUE('Table'[Date]),0)=EOMONTH(TODAY(),0),
    SELECTEDVALUE('Table'[Date]),
    EOMONTH(SELECTEDVALUE('Table'[Date]),0)
)

Irwan_2-1749359696478.png

Irwan_1-1749359684550.png

 

 

Thank you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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