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
Anonymous
Not applicable

% not adding up when using YTD

Hi All,

 

I have two measures;

Att YTD2 = CALCULATE([Overall Att rate],DATESYTD('dimDates'[Date]),filter(dimDates,dimDates[DateId]))
Overall Att rate = [Present Att]/[Total Session Count]
 
But they both report different results, I added the filter on the ATT YTD2 as I could see it was including everyday in the calendar and not taking into account weekends and holidays, does it still calculate over 365 days regardless?
 
       overall              ATT YTD
AndyM12_0-1636104282751.png

Is there another way to calculate YTD or is there anything else to consider when using YTD?

 

Many Thanks

 

Andy

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , YTD should be like

 

Att YTD2 = CALCULATE([Overall Att rate],DATESYTD('dimDates'[Date]))

 

and dimDates should be marked as a date table

 

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

it still calculates the same value without the filter, i added the filter in the hope that was the issue as we only work on acedemic years and dont want to count non school days.

DimDates is marked as a date table

 

We 

Hi @Anonymous ,

According to your description, you want dates not including weekends, here’s my solution.

1.Create a new date table.

vkalyjmsft_0-1636365534973.png

 

2.Use the date table to calculate.

vkalyjmsft_1-1636365534977.png

 

 

Or you are still confused about it, please provide me with a sample and the output you expect.

About DATESYTD function, you can refer to the following blog:

https://docs.microsoft.com/en-us/dax/datesytd-function-dax

 

Best Regards,
Community Support Team _ kalyj

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

Anonymous
Not applicable

The question is more around what is YTD doing to my measure?

my assumption was that YTD was including non school days,  weekends holidays etc and rounding the numbers over the extra days.

 

I have selected last year 

AndyM12_1-1636380133912.png

 

When I put the overall measure in a line chart by month it reports the same calculation as the YTD measure.

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.