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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Today and Yesterday Totals

Hello Community -  I have tried this measure below, but it gives me YTD values.   What I want is just today, specifically.    

 

So, for example if we shipped 500,000 dollars YTD....but today we just shipped 25,000....I want the card visual to say $25,000

 

Today Net Shipped Revenue = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),FILTER('Date Table',TODAY()))
 
Likewise for yesterday.   I tried using PreviousDay, but the only way it gives me the correct value is if I am filtered down on a visual that shows today's date.   Then, the card visual shows me the correct value for Yesterday.    But not what I am looking for.  I need the card visual to always show the specifical value for yesterday's shipments, regardless of any other filters applied on the page.   Thanks Community!
 
Shipments Yesterday = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),PREVIOUSDAY('Date Table'[Date]))
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous I would keep it simple:

 

Today Net Shipped Revenue = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),'Date Table'[Date] = TODAY())

Today Net Shipped Revenue = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),'Date Table'[Date] = TODAY()-1)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous I would keep it simple:

 

Today Net Shipped Revenue = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),'Date Table'[Date] = TODAY())

Today Net Shipped Revenue = CALCULATE(SUM(ShippedOrdersALL_Query[ShippedPrice]),'Date Table'[Date] = TODAY()-1)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank You @Greg_Deckler    Worked perfectly.

selimovd
Super User
Super User

Hey @Anonymous ,

 

why don't you use DATEDD with -1 DAY from TODAY(). Like this you should get the value from yesterday.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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