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.
Year | Month | Sales | SalesPytd |
2019 | Oct | 200 | 200 |
2019 | Nov | 100 | 300 |
2019 | Dec | 300 | 600 |
2020 | Jan | 100 | 700 |
2020 | Feb | 200 | 900 |
I want to create something like this. If today is 22 may 2020 then my sales PYTD should be from 1 Jan 2019 to 22 May 2020
So couple ways to do that @Ethanhunt123, if you go down the time intelligence route, you would create a separate Date table and use probably use something like TOTALYTD to calculate your YTD measure. Maybe something like CALCULATE(SUM([Column]),TOTALYTD('Dates'[Date]) .
https://docs.microsoft.com/en-us/dax/totalytd-function-dax
Then you would use something along the lines of CALCULATE([ytd measure],SAMPERIODLASTYEAR('Dates'[Date])) for example.
The other way, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |