The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have data like this :
Date | Unit Sales |
Jan-97 | 63 |
Feb-97 | 26 |
Mar-97 | 20 |
Apr-97 | 41 |
May-97 | 83 |
Jun-97 | 40 |
Jul-97 | 88 |
Aug-97 | 95 |
Sep-97 | 74 |
Oct-97 | 67 |
Nov-97 | 52 |
Dec-97 | 10 |
Jan-98 | 35 |
Feb-98 | 75 |
Mar-98 | 32 |
Apr-98 | 46 |
May-98 | 37 |
If I want to calculate YTD 1997, it's not Full Year in 1997 but until May 1997 like YTD 1998 until May 1998. So do I if I want to calculate YTD 1996, it's until May 1996. Thanks for the solution
Hi. First of all you need to understand that any time intelligence calculations work with a Date Table. Date table are necesary so the engine can run specific time calculations la year to date. Once you hace this data model prepared you can create a measure like this:
Measure YTD = CALCULATE ( [Measure Unit Sales], DATESYTD ( 'DateTable'[Date], "04/30" ) )
Happy to help!