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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
AndrewHam
Helper I
Helper I

How to retain calculated value ?

hi Superusers,

I have created a formula ; Part Count = Calculate(Part_Count,FILTER(Table1,Table1_date = Today()),

The objective is to automatically update the part count in a table after a schedule refresh.

However I am facing 2 issues;

1. The formula is unable to retain the previous date value. It will calculate the Part count for today but will change previous day calculation to NULL.

2. Not sure how to write a formula to only do the calculation.

 

Can someone provide some advice ?

 

Thanks

 

4 REPLIES 4
ImkeF
Community Champion
Community Champion

Hi @AndrewHam ,
unfortunately I still don't understand your requirement (given the fact that Power BI is not able to persist data in visuals, as the will be re-generated everytime the page is refreshed).
But as your question is specific to DAX, I would strongly recommend to post it in the appropriate forum over here: Desktop - Microsoft Power BI Community
as this is the Power Query section.



Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

thanks for the advice. I have reposted my question in the desktop.

ImkeF
Community Champion
Community Champion

Hi @AndrewHam ,
not sure what your requirement exactly is, but how about using <= Today instead? That would keep all values previous to today as well.
 Part Count = Calculate(Part_Count,FILTER(Table1,Table1_date <= Today())


Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

hi ImkeF,

thanks for the inputs.

I cannot use <= Today() because the data is changed daily and I want a snapshot of the part count.

Example, I want the part count from 1/1/2023 to 5/1/2023 every day and this value is obtained through a measure.

Any inputs are welcome !

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.