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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculating YTD/MTD/QTD without date level entry in the source table

Hello There

 

I am wondering if someone could help me if calculating YTD/MTD/QTD is possible with no date level entry in the fact table. Also, we maintain a seperate calendar table with date & other information as follows.

 

How do we use it for YTD/MTD/QTD calculation?

 

For instance, we have records given below.

FY/FWK/Branch/Sales Revenue (fact)

2019/01/New York/23441.323

2019/02/New York/17434.323

----

 

Calendar Date/FY/FWK/FQTR/FMTH/FPD

10-05-2019/2019/48/4/12/2

11-05-2019/2019/48/4/12/2

----

 

Appreciate your help.

 

Regards

Kishorekumar

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

Hi @Anonymous 

 

I created a sample as yours, we can add the YTD using below measure:

YTD = CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Fact table'[FY]))

11.png

When you create the QTD, you can manage the relationship with calendar table to get the Qtr :

12.png

And then use the measure below to create QTD and MTD:

QTD = 
CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Table'[FQTR]),VALUES('Fact table'[FY]))

13.png

MTD = CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Table'[MTH]),VALUES('Fact table'[FY]))

14.png

Pbix attached here for your reference : https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EXl8Q9gpyMxLhmbIXC-t9VcBpNhMfG-ovaAY2XBNf5-Bag?e=Yl9z2x

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
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-diye-msft
Community Support
Community Support

Hi @Anonymous ,

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
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 Dina

 

Apologies for reaching out late as I was away for couple of weeks. Yes, the solution provided did help our case.

 

Also, would like to seek help on how the Current week this year/last year/Avg 6 weeks TY & LY (sale week numbers) sales revenue is handled in this situation.

 

I tried the following and was not successful.

 

Sales LY TW =
VAR CurrentWeek = SELECTEDVALUE(FACT_WEEKLY_SUMMARY[Fiscal_Week])
VAR CurrentYear = SELECTEDVALUE(FACT_WEEKLY_SUMMARY[Fiscal_Year])
VAR MaxWeekNumber = CALCULATE(MAX(FACT_WEEKLY_SUMMARY[Fiscal_Week]), ALL(FACT_WEEKLY_SUMMARY[Fiscal_Year]))
RETURN
SUMX(
FILTER(ALL(FACT_WEEKLY_SUMMARY),
IF(CurrentYear = 1,
FACT_WEEKLY_SUMMARY[Fiscal_Week] = MaxWeekNumber && FACT_WEEKLY_SUMMARY[Fiscal_Year] = CurrentYear -1,
FACT_WEEKLY_SUMMARY[Fiscal_Week] = CurrentWeek && FACT_WEEKLY_SUMMARY[Fiscal_Year] = CurrentYear -1)),
FACT_WEEKLY_SUMMARY[Sales_Val])
 
Any help would be great.
 
 
Report Requirement: 
** Bold marked -- Working as expected with your solution.
Sales Revenue/TY this week/LY this week/YTD TY/YTD LY/MTD TY/MTD LY/Avg 6 weeks TY/Avg 6 Weeks LY
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

I created a sample as yours, we can add the YTD using below measure:

YTD = CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Fact table'[FY]))

11.png

When you create the QTD, you can manage the relationship with calendar table to get the Qtr :

12.png

And then use the measure below to create QTD and MTD:

QTD = 
CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Table'[FQTR]),VALUES('Fact table'[FY]))

13.png

MTD = CALCULATE(SUM('Fact table'[Sales Revenue]),FILTER(ALL('Fact table'),'Fact table'[FWK]<=MAX('Fact table'[FWK])),VALUES('Table'[MTH]),VALUES('Fact table'[FY]))

14.png

Pbix attached here for your reference : https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EXl8Q9gpyMxLhmbIXC-t9VcBpNhMfG-ovaAY2XBNf5-Bag?e=Yl9z2x

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.