Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AWentzEco
Frequent Visitor

How to get the current YTD value in a Scorecard

I am using 2 Measure for YTDs and can see the Forecast values are correct by Month-Year in the table, but cannot figure out how to get the current YTD forecast value into a scorecard (single value based on current Month when viewing). The value circled below in the pic is what I'm after - and obviously will change based on the month we're in. I'm guessing another Measure is needed. I tried to use "LASTNONBLANK" but cannot figure out the correct syntax in combination with the measure below (YTD_NOW).  Any help would be appreciated.

 

My YTD Measures are:

YTDTotal = TOTALYTD(sum('MyTable'[SavingsAct-Fcst Value]),'MyTable'[Savings Date].[Date])
YTD_NOW = if(LASTDATE('MyTable'[Savings Date].[Date]) > TODAY(), BLANK(), CALCULATE([YTDTotal]))
 
YTD Issue.jpg
2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@AWentzEco change your YTD Now measure like this

 

YTD Now = 
CALCULATE( 
[YTDTOTAL],
KEEPFILTERS( MyTable[Savings Date] <= TODAY() )
)


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.

View solution in original post

Ok, I just updated the 'KEEPFILTERS' to 'FILTER' and it works!! I think this solved it - thank you for the help.

YTD_AGAIN = CALCULATE([YTDTotal],FILTER(‘MyTable,’MyTable'[Savings Date].[Date] <= TODAY()))

 

YTD Measure in Scorecard.png

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@AWentzEco change your YTD Now measure like this

 

YTD Now = 
CALCULATE( 
[YTDTOTAL],
KEEPFILTERS( MyTable[Savings Date] <= TODAY() )
)


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.

I created the new Measure and then tried using that in the Scorecard and it's still a blank value. Only when I click on the table value will the measure value appear in the Scorecard. Do I need to use Var with an IF to get today's value in there for the measure? I know I'm missing the Date link or something since none of those YTD measures I created work in the Scorecard - they all show as 'blank'.

 

YTD_AGAIN = CALCULATE([YTDTotal],KEEPFILTERS(‘MyTable’[Savings Date] <= TODAY()))

YTD Measure is blank in scorecard.png

Ok, I just updated the 'KEEPFILTERS' to 'FILTER' and it works!! I think this solved it - thank you for the help.

YTD_AGAIN = CALCULATE([YTDTotal],FILTER(‘MyTable,’MyTable'[Savings Date].[Date] <= TODAY()))

 

YTD Measure in Scorecard.png

@AWentzEco glad to hear. enjoy!! 🙂



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.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors