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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Orstenpowers
Post Patron
Post Patron

YTD and PYTD measure does not work with full months

I am trying to calculate YTD and PYTD measures.

As I want to show full months only, today my visual for YTD should end with the values by end of February 2024 and for PYTD with the values by end of February 2023...However, with the formula that I used it does not work as expected. So, the current month should be surpressed... What do I need to adjust in order to filter out the current month with the DAX below?
My formula is as follows:

IO YTD CY (full month) =

VAR max_date =
CALCULATE(
    MAX('Date Table (Ref Transaction Date)'[Date]),
    FILTER(ALL('Date Table (Ref Transaction Date)'), 'Date Table (Ref Transaction Date)'[Order date < TODAY()]))

RETURN

TOTALYTD(
    SUM(SALES_DATA[F GC / Sales Order Net Amount]),
    'Date Table (Ref Transaction Date)'[Date],
    'Date Table (Ref Transaction Date)'[Date] <= EOMONTH(max_date,-1))
 
This is the original proposal that I tried to adapt for my purpose...
PBI_Comm_010.JPG
2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Do these measures work?

Measure = calculate(SUM(SALES_DATA[F GC / Sales Order Net Amount]),datesbetween(calendar[date],date(year(today()),1,1),eomonth(today(),-1)))

Measure1 = calculate([measure],sameperiodlastyear(calendar[date],"31/12"))

If not, then share the download link of the PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.