Forum Discussion
How to make Line Chart stop mid-graph for future dates
- 9 years ago
Hi Jason,
Happy to help. If this is a numerical column then you might want to try using the BLANK() function. My first thought would be to write an IF statement asking of the Date on your axis is less than or equal to today's date. If true then it would return the value from your formula, if false it would return BLANK(). So something potentially like this. Let me know if this helps or gets you closer.
=IF( Table[Date] <= TODAY(), [Formula], BLANK() )
This is great, thanks so much Reid_Havens! Bottom line is, I was trying to do too much data prep in Excel, when I should have just done it in Power BI.
The one tweak I had to make to your formula was to make the Logical Test of the IF statement an OR to ensure my "Goal Line" is included for the future dates. So, it's something like:
=IF( OR( Table[Date] <= TODAY(), Table[Name]="Goal"), [Formula], BLANK() )
Fantasic. Good evolution of the formula and glad you were able to find a solution.
- acrow7 years agoNew Member
Hi, I have managed to get my cumulative measure to stop at a particular point (Cost Period = 4) and fill the future with BLANK()
However when plotting using Line Chart the Yellow line just goes horizontal (flat line) even though values are BLANK.
Can anyone advise what I am doing wrong?
- acimisliin7 years agoRegular Visitor
Hi,
Please check this DAX measure:
Cumulative NSI = IF( MAX('Calendar'[Date]) > TODAY(), BLANK(),CALCULATE(SUM(AllBusinessSales[NSI]),FILTER(ALLSELECTED( 'Calendar' ),'Calendar'[Date] <= MAX('Calendar'[Date]))))The trick is to put BLANK() after today.