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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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?
➤ 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.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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