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
Rapier
Frequent Visitor

Turn YTD logic with quarterly data (fill the gaps)

Hi,

 

I faced with the following issue, where I should find any solution to "turn back" the logic of YTD:

 

There are some countries, where we received data quarterly (Q1 --> in April, Q2 --> in July, etc.).

I should show YTD, but not with the common logic. 

The request is: if Q1/2021 data is received, it should be allocated to Jan/Feb/Mar of 2021, but not to Mar/Apr/May of 2021.

As an example there is the following screenshot.

 

 

Rapier_0-1657012821443.png

 

 

I think it will be confusing for some users (data change for past months after three month), but at the end the client wouldn't like to see blank month between december (last data for a year) and march (first data for an other one).

I feel it absolutely uncommon request based on what I experienced, but they are very uncomplying.

Is it possible to solve it somehow with DAX, or should we transform the data (and/or data model) for this?

 

Thank you for your help!

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi Rapier,

 

Please try:

 

Request Logic =

var _c = CALCULATE(SUM('Values'[Data]),FILTER('Values',MONTH('Values'[Month])<MONTH( EARLIER('Date'[Month]))+3 &&YEAR([Month])=YEAR( EARLIER([Month]))))

var _d = CALCULATE(MAX('Values'[Data]),FILTER('Values',MONTH([Month])=3))

return IF(MONTH('Date'[Month])<3,_d,_c)

 

Output:

vjianbolimsft_0-1657533887930.png

 

Best Regards,

Jianbo Li

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-jianboli-msft
Community Support
Community Support

Hi Rapier,

 

Please try:

 

Request Logic =

var _c = CALCULATE(SUM('Values'[Data]),FILTER('Values',MONTH('Values'[Month])<MONTH( EARLIER('Date'[Month]))+3 &&YEAR([Month])=YEAR( EARLIER([Month]))))

var _d = CALCULATE(MAX('Values'[Data]),FILTER('Values',MONTH([Month])=3))

return IF(MONTH('Date'[Month])<3,_d,_c)

 

Output:

vjianbolimsft_0-1657533887930.png

 

Best Regards,

Jianbo Li

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

amitchandak
Super User
Super User

@Rapier , Not very clear. I worked on allocation logic for yearly data, but the same can be done on quarterly data

 

Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-C...

 

Distributing/Allocating the Yearly Target(Convert to Daily Target): https://community.powerbi.com/t5/Community-Blog/Distributing-Allocating-the-Yearly-Target-Convert-to...

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

@amitchandak Thanks for your help, and maybe the solution at the end will be something similar, but make this things clear I attach an Excel table, where I try to show you the exact request: 

 

YTD example.png

 

 Otherwise I can't attach the original file, but this part of data is very simple, like this:

 

YTD = TOTALYTD(SUM('Values'[Data]),'Date'[Months])

 

Rapier_1-1657021959281.png

Rapier_2-1657021980835.pngRapier_3-1657021992459.png

 

  YTD_vizz.png

 

 

 

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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