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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JonasDedual
Helper I
Helper I

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 @JonasDedual  ,

 

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 @JonasDedual  ,

 

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.

 

JonasDedual
Helper I
Helper I

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

@JonasDedual , 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.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.