Forum Discussion
JST15
2 years agoHelper I
X-Axis Constant Line Missing Even with Date Data Type
Hi all! I've seen a lot posted about x-axis constant but I still can't figure out why mine isn't showing. Please see below. I'm using a line chart with Date hierarchy (year and month) but don't see...
- 2 years ago
Hi
The x-axis needs to be numeric[ex: year], so that you can quantify where the constant line in x axis should be added. Since you have month/year[which is string+numeric] on your x axis, you lose the ability to add x axis constant line.
With current structure you can leverage error bars to add a line as below.Error =Var tes = CALCULATE(max(FactSales[SalesAmount]),ALLEXCEPT(FactSales,DimDate[CalendarYearLabel],DimDate[FiscalMonthLabel]))
return if(ENDOFMONTH(DimDate[Datekey])=DATE(2008,08,31),tes,0)
Replace the DATE(2008,08,31) to capture you actuals end month, I would advice to make it dynamic to change each month. Then add erro bar as below, Format the bar as per your need.
You can play around with both upper and lower bound[Best practice to make them dynamic according to your y axis values] to create even longer lines to mimic constant lines.
Will this be a good solution for you?
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!! - 2 years ago
This solution is working great. Thank you!
NaveenGandhi
2 years agoMemorable Member
Hi
The x-axis needs to be numeric[ex: year], so that you can quantify where the constant line in x axis should be added. Since you have month/year[which is string+numeric] on your x axis, you lose the ability to add x axis constant line.
With current structure you can leverage error bars to add a line as below.
Error =
Var tes = CALCULATE(max(FactSales[SalesAmount]),ALLEXCEPT(FactSales,DimDate[CalendarYearLabel],DimDate[FiscalMonthLabel]))
return if(ENDOFMONTH(DimDate[Datekey])=DATE(2008,08,31),tes,0)
Replace the DATE(2008,08,31) to capture you actuals end month, I would advice to make it dynamic to change each month. Then add erro bar as below, Format the bar as per your need.
You can play around with both upper and lower bound[Best practice to make them dynamic according to your y axis values] to create even longer lines to mimic constant lines.
Replace the DATE(2008,08,31) to capture you actuals end month, I would advice to make it dynamic to change each month. Then add erro bar as below, Format the bar as per your need.
You can play around with both upper and lower bound[Best practice to make them dynamic according to your y axis values] to create even longer lines to mimic constant lines.
Will this be a good solution for you?
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!