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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KRISH80
Helper II
Helper II

MTD, QTD and YTD calculations

ERROR.png

 

I need to calculate the MTD, QTD and YTD total Sales. Our Fiscal Yera beigns in April and ends in Mar. So For us it is FY 2020 and Q1 is Apr-19 to Jun-19, Q2 is Jul-19 to Sep-19, Q3 is Oct-19 to Dec-19 and Q4 is Jan-20 to Mar-20.

 

I have a measure created called "Total-Wins" and i have a Date Table. I am using the formual : 

Sales QTD = CALCULATE([TOTAL-WINS],DATESQTD(Dates[Date])) but it is returning below  - 
 
Can someone help me sort this out ? My Quarter should start from Apri-19 here it is treating as Q2. Because of this i guess my total is also showing wrong. Please help.
 
 
5 REPLIES 5
kentyler
Solution Sage
Solution Sage

Here's an answer from another post

 
 
 
Super User
Re: Custom Quarter periods used in calculations

You would need to use a DAX variable and CALCULATETABLE function with that variable formula and use that in place of the DATESQTD. I would replace your DATEADD -1 and QUARTER with an equivalent number of days -90 DAYS for example.

so....

everyplace you have DATESQTD you need to replace that expression with a CalculateTable expression 
you would set the dates you want to use to calculate the quarters by using a parameter table perhaps, or just as variables in your Measure
If you need help with the actual DAX code just holler.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Kindly help me with a Dax code please

Ok

Can you send my your Power BI File ?





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Sure. Any email I'd to share?

ken@8thfold.com

i'm off for the night, but i'll have something for you in the morning

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors