Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi ,
I would like to show YTD revenue figures for this year, last year and target on the same line chart.
When I try to pull last year data, PowerBI treats it as one continuous dataset as all dates are coming from a date table.
This is what I have. I just
the DAX used to calculate YTD values is:
Please note, I am operating in direct query mode hence calcualted columns are not an option for me.
@rajulshah almost but not quite there.
The DAX you provided results in the billow visual.
I think this is because the revenue for each year resides in two seperate tables.
So i have a table called FY23 and another called FY22. I think the sameperiodlastyear function checks for datafrom the last year in FY23 table, except there isn't any? and for some reason it's spitting it out as FY24 instead.
Not sure, that could be the reason.
You can create a measure as follows:
YTD_Billed22 = CALCULATE ( [YTD_Billed] , SAMEPERIODLASTYEAR ( 'Fiscal Year Table' [ Date ] ) )Please let me know if this didn't work.
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 32 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 37 | |
| 27 | |
| 24 |