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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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)

@ 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!:
The Definitive Guide to Power Query (M)

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)

@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.