Forum Discussion
yashwant101
Helper III
2 years agoNeed vertical line in bar graph
Hi all, I am showing a bar graph to the clients. The graph is a monthly chart with months on x-axis. I need a vertical dashed or dotted line after one specific month. I cnnot put any shape or ima...
- 2 years ago
Hi yashwant101 - i have used with some sample data and in line chart you can use reference line and based on date create a measure and add conditional formatting.
can you try the above logic
SignificantChange1 =VAR CurrentMonthValue = SUM(financials[Profit])VAR PreviousMonthValue = CALCULATE(SUM(financials[Profit]), DATEADD(financials[Date], -1, MONTH))VAR PercentageChange =IF(NOT ISBLANK(PreviousMonthValue),DIVIDE(CurrentMonthValue - PreviousMonthValue, PreviousMonthValue, 0),0)RETURNIF(PercentageChange >= 0.2, 1, 0) -- Assuming a 20% change is significantDid I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
yashwant101
Helper III
2 years agoHi rajendraongole1 ,
I have not been allowed to share file yet but I can attach a screenshot:
Below is the expected graph:
In the above line and bar chart, we have a vertical dashed line for Oct-2023. That indictes that there was a significant change related to the orgnization in that month. I want to do this in Power BI for specific month.
rajendraongole1
Super User
2 years agoHi yashwant101 - i have used with some sample data and in line chart you can use reference line and based on date create a measure and add conditional formatting.
can you try the above logic
SignificantChange1 =
VAR CurrentMonthValue = SUM(financials[Profit])
VAR PreviousMonthValue = CALCULATE(SUM(financials[Profit]), DATEADD(financials[Date], -1, MONTH))
VAR PercentageChange =
IF(
NOT ISBLANK(PreviousMonthValue),
DIVIDE(CurrentMonthValue - PreviousMonthValue, PreviousMonthValue, 0),
0
)
RETURN
IF(PercentageChange >= 0.2, 1, 0) -- Assuming a 20% change is significant
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Appreciate your Kudos!!