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

dynamically calculate week to dates sales

Hello All,

 

I have a report where I am having daily dates and sales.

My requirement is I need to show week to date sales dynamically.

If the end user runs the report today I need to show 26,27 and 28 sales sum   ( 800)

If the end user runs report tomorrow then I need to show 26,27, 28  and 29th sales sum 

 

Could any one please help how to do.

 

Date                              Sales

21/11/2023100
22/11/2023200
23/11/2023300
24/11/2023600
25/11/2023200
26/11/2023100
27/11/2023500
28/11/2023200
  
  
  
  
output : 
wtd sales800
4 REPLIES 4
Sahir_Maharaj
Super User
Super User

Hello @Anonymous,

 

Can you please try this DAX:

WTD Sales = 
CALCULATE(
    SUM(TableName[Sales]), 
    FILTER(
        TableName,
        TableName[Date] >= STARTOFWEEK(TODAY()) && 
        TableName[Date] <= TODAY()
    )
)

 

Should you have any questions, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Anonymous
Not applicable

Hi @Sahir_Maharaj ,

 

Thanks for your respense.

Since I have lot of measures in my report I need only wtd calculation so that I can keep in filters and select true.Then all the measures will change based on calculation

 

Can you please change your calculation to give the wtd instead of calculation sales for wtd

miTutorials
Super User
Super User

PijushRoy
Super User
Super User

@Anonymous 

What is the Logic, you need to show the last 3 days' data or the last 4 days' data
In your 1st Example, you are showing last 3 days data
In 2nd example, you are showing last 4 days data
I am not clear about the logic.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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.