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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

YTD in Matrix Table

Hi

 

I am trying to use YTD in a Matrix table.

 

On the Y Axis, I have Main product Group, Product Group and Product.

On the X Axis I have the Years.

JonasDedual_0-1619766779366.png

 

The Problem I am currently facing is to add YTD on the X Axis for each year. Any suggestions how to solve this issue?

 

Thanks in Advancce!

 

kind regards

Jonas

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous  ,

 

Please refer to this:

https://community.powerbi.com/t5/Desktop/SAMEPERIODLASTYEAR-with-a-year-filter/td-p/91501 

If the problem persists,could you share the sample pbix with dummy data?

 

Best Regards,
Liang
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

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous  ,

 

Please refer to this:

https://community.powerbi.com/t5/Desktop/SAMEPERIODLASTYEAR-with-a-year-filter/td-p/91501 

If the problem persists,could you share the sample pbix with dummy data?

 

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

 

Anonymous
Not applicable

Hi

 

Yes, I with YTD I mean the period for each year:

1.1.2021 - 30.04.2021

1.1.2020 - 30.04.2020

1.1.2020 - 30.04.2019

.....

 

However I am quite confused about the date table with your comment:

"For that create a date table, join date of date with order date. Add year to date table and use that year in visual"

 

 

Im not really sure what needs to be in that date table. I have created something like that but I doubt that this is correct:

 

Date = SUMMARIZE('Lian CH$Sales Invoice Line','Lian CH$Sales Invoice Line'[Order Date].[Date], 'Lian CH$Sales Invoice Line'[Order Date].[Year],'Lian CH$Sales Invoice Line'[Order Date].[Month],'Lian CH$Sales Invoice Line'[Order Date].[Day])

 

 

amitchandak
Super User
Super User

@Anonymous , what to mean by ytd here, each year only till April ?

For that create a date table, join date of date with order date. Add year to date table and use that year in visual

 

Create measure like

YTD Corrected =
var _max = format(today(),"MMDD")
return
calculate(Sum('Table'[AmountNoavt]),DATESYTD('Date'[Date]),format('Date'[Date],"MMDD")<=_max)

or
YTD Corrected =
var _max = format(today(),"MMDD")
return
if(format(max('Date'[Date]),"MMDD")<=_max, calculate(Sum('Table'[AmountNoavt]),DATESYTD('Date'[Date])),blank())

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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