Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've made a line chart showing 3 lines, each is a Percentage (y-axis) over Time (x-axis):
1. A "goal" line that has pre-populated data (see black line below)
2. Two data lines showing progress related to that goal (red and green lines below)
The data lines do not have values for future dates and I'd like that line just to stop mid-graph after today's date. But, I can't figure out how because I want the goal line to continue into the future.
I'm importing data from Excel and have tried 0's for future values, but that looks bad as the line just jumps down to the x-axis where y=0 (see screenshot below). And I've tried blanks ("") and NA() values in Excel, but they cause an data mismatch error in Power BI because it's set to a Percentage.
Solved! Go to Solution.
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() )
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.
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?
Hi,
Please check this DAX measure:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |