Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
Looking at the following two charts, we can see the lower one has a gap between March and April in the area shown.
I'd like to show the missing element in the lower chart but unfortunately it isn't available within my source data.
I've been trying to use an IF statement to determine if the PREVIOUSMONTH = 0 then use the value from the 'Spent' column as the start point for the line but am struggling to do so.
The source excel file and the pbix files can be found via this link.
It isn't possible to change the source data.
Anyone got any ideas or the best way to approach this one so that I can get the lower chart to look like the top chart (and still not show a line for the Jan/Feb months despite them being 0 also)?
Thanks,
Richard
Solved! Go to Solution.
@RichardJ here you go
Remaining Measure =
VAR __minDate =
CALCULATE (
MIN ( 'Power_BI_Feed_Data Set B'[Date] ),
ALLSELECTED(),
'Power_BI_Feed_Data Set B'[Remaining] <> BLANK()
)
VAR __lastMonth = EOMONTH ( __minDate, -1 )
VAR __lastMonthSpent = CALCULATE ( SUM ( 'Power_BI_Feed_Data Set B'[Spent] ), EOMONTH ( 'Power_BI_Feed_Data Set B'[Date], 0 ) = __lastMonth )
RETURN
SUM( 'Power_BI_Feed_Data Set B'[Remaining] ) +
IF ( EOMONTH ( MAX ( 'Power_BI_Feed_Data Set B'[Date] ), 0 ) = __lastMonth, __lastMonthSpent )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@RichardJ use following measure for remaining instead of direct column
Remaining Measure = SUM( 'Power_BI_Feed_Data Set B'[Remaining] ) + 0
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks for taking the time to respond @parry2k but the measure you are suggesting shows the line as follows where i'd like the line to meet the top of the March column plus not show any line for the January and February months
@RichardJ try this measure
Remaining Measure =
VAR __minDate =
CALCULATE (
MIN ( 'Power_BI_Feed_Data Set B'[Date] ),
ALLSELECTED(),
'Power_BI_Feed_Data Set B'[Remaining] <> BLANK()
)
VAR __lastMonth = EOMONTH ( __minDate, -1 )
RETURN
SUM( 'Power_BI_Feed_Data Set B'[Remaining] ) +
IF ( EOMONTH ( MAX ( 'Power_BI_Feed_Data Set B'[Date] ), 0 ) = __lastMonth, 0 )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
So close. Nice approach and not one i'd thought of. Thanks @parry2k .
Is there any way I can extract the value for the previous month(March) and add it to the zero value so that the line starts at the top of the bar?
@RichardJ here you go
Remaining Measure =
VAR __minDate =
CALCULATE (
MIN ( 'Power_BI_Feed_Data Set B'[Date] ),
ALLSELECTED(),
'Power_BI_Feed_Data Set B'[Remaining] <> BLANK()
)
VAR __lastMonth = EOMONTH ( __minDate, -1 )
VAR __lastMonthSpent = CALCULATE ( SUM ( 'Power_BI_Feed_Data Set B'[Spent] ), EOMONTH ( 'Power_BI_Feed_Data Set B'[Date], 0 ) = __lastMonth )
RETURN
SUM( 'Power_BI_Feed_Data Set B'[Remaining] ) +
IF ( EOMONTH ( MAX ( 'Power_BI_Feed_Data Set B'[Date] ), 0 ) = __lastMonth, __lastMonthSpent )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@RichardJ it will show something like this
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
123 | |
76 | |
62 | |
50 | |
49 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |