Forum Discussion
Hide partial YTD Column
- 8 years ago
Hi,
Try this formula
IncrementTr YTD = if(VALUES('Date'[Date])<=TODAY(),CALCULATE([IncrementTr Total],DATESYTD('Date'[Date],"30/6")),BLANK())
- 8 years ago
You could use an IF condition (either as a measure or new conditional column) to check whether there are values for that date and assign 0 as the value if it is blank.
Do you have a Date table and what is the relationship with the table that has the values?
Again more details of your data model and the sample PBIX file will help to understand your problem and help you.
Here the link:
https://drive.google.com/drive/folders/1P10op_192ac_m-QGqt-QjolaLZSIMc_t?usp=sharing (Filename: TrackingExample)
There is a date dimension table and two other tables. One (RegistrationTarget) contains target values for the rest of the year. Second (RegistrationTracking) contains the historical data which I would only like to see until today and 'blank out' the remainder of the year to come.
Thanks!
- anandav8 years agoSkilled Sharer
Glad you found the solution.
Another approach is to use cummulative total pattern:
IncrementTr YTD =
CALCULATE( sum(RegistrationTracking[Increment]), filter(All('Date'), 'Date'[Date] <= Max(RegistrationTracking[SnapshotDate])))The advantage is you don't have to hard code the end date.
Check this article :
Calculating Cumulative Or Running Totals In Power BI using DAX
- DieLem8 years agoHelper II
Hey anandav this also works, thanks!
I hear what you say about not hard coding, that's wise.
Both solutions work. However when I add a field to the column series to split graph into different revenue streams (PackageCode) it suddenly jumps the whole screen.
Is there a reason for this?