Forum Discussion
Line chart intermittent line
Hello power bi experts !
It is any possibility to do line chart like in my picture ?
W - it is week, for example 1,2,3,4,5
Hi hylosko ,
According to the documentation, we can only set predicted values for incremental numeric or date x-axis.
Introducing new forecasting capabilities in Power View for Office 365 :
Forecast is available for line charts only. The x-axis value needs to have a date/time format or be a uniformly increasing whole number.
- It can’t contain text or decimal numbers.
- Sometimes x-axis values appear to be dates, but they’re actually formatted as text. They won’t work for forecasting.
If you still want the x-axis of the line chart to contain text, then you need to create measures for the forecast values. For example, in my example data, I used a simple linear regression equation to predict the value( [Simple linear regression] ), which means that the measure is equivalent to the FORECAST function in Excel. You can use other methods for prediction as needed.
Measure = VAR lastnotblankweek = CALCULATE ( MAX ( Dates[WeekNum] ), FILTER ( ALLSELECTED ( 'Table' ), [SumValue] <> BLANK () ) ) RETURN IF ( MAX ( Dates[WeekNum] ) = lastnotblankweek, [SumValue], IF ( [SumValue] = BLANK (), [Simple linear regression] ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- amitchandakSuper User
hylosko , You need to have two measures, One line might not serve the purpose
if you are looking for forecasting, there is an option in analytics in visualization property pane
- hyloskoHelper III
Can you please show sample how i can do that with any two measures ?
- hyloskoHelper III
and second question is any possibility to do second measure like the dotted line
?
- v-kkf-msftCommunity Support
Hi hylosko ,
According to the documentation, we can only set predicted values for incremental numeric or date x-axis.
Introducing new forecasting capabilities in Power View for Office 365 :
Forecast is available for line charts only. The x-axis value needs to have a date/time format or be a uniformly increasing whole number.
- It can’t contain text or decimal numbers.
- Sometimes x-axis values appear to be dates, but they’re actually formatted as text. They won’t work for forecasting.
If you still want the x-axis of the line chart to contain text, then you need to create measures for the forecast values. For example, in my example data, I used a simple linear regression equation to predict the value( [Simple linear regression] ), which means that the measure is equivalent to the FORECAST function in Excel. You can use other methods for prediction as needed.
Measure = VAR lastnotblankweek = CALCULATE ( MAX ( Dates[WeekNum] ), FILTER ( ALLSELECTED ( 'Table' ), [SumValue] <> BLANK () ) ) RETURN IF ( MAX ( Dates[WeekNum] ) = lastnotblankweek, [SumValue], IF ( [SumValue] = BLANK (), [Simple linear regression] ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.