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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
amandabus21
Helper V
Helper V

YTD Calculation

Hello, 

 

Im having some toruble getting a YTD Calculation.


This is what I am trying to recreate. 

amandabus21_2-1665071660745.png

 

 

When I recreate in Power BI using Year-to-Date quick measure, it is not giving me the same numbers:

 

amandabus21_3-1665071703936.png

 

 

 
ridership_kpi YTD =
IF(
    ISFILTERED('agency_daily_ridership'[Merged FC]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    TOTALYTD(
        SUM('agency_daily_ridership'[ridership_kpi]),
        'agency_daily_ridership'[Merged FC].[Date]
    )
)

 

2 REPLIES 2
Anonymous
Not applicable

Hi,

 

Power BI asked you to create a Date Table. Without this you can not use the YTD functions

So create a date table, declare it as date and link it with your table and it will work.

Hope it helps

Hi @Anonymous , 

 

I do believe i have date table named "merged FC".

 

I think what is happening in my year to date is that it is adding every month until the end of the year. But what I need is all the sum from that month last year to the month next year.


For example sum of all ridership from August 2022 -August 2023. 

 

Not July + August.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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