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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Alex_Hasan
Helper II
Helper II

Dax

Hello good people, I was given the assignment below to solve this. As a newcomer in PBI, I find it confusing. I tried hard and solved the problem, but it seems I actually messed up with the solution. Now I've submitted the solution file and I will be happy if someone kindly solves the problem so that I can learn from my mistakes. Could anyone please help me with the solution?

https://drive.google.com/file/d/1FhyexInp3ghfep3BG0wnPUoFX_Ki1O9m/view?usp=sharing 

Case:

Executives at a local grocery distributor are looking for some analysis on the data they have provided in the tab named SAP Data Extract. 
1. Assume the current date is November 15, 2016.
    - Use a Calendar Dimension ( PowerQuery)
    - Achieve this by using a slicer, so we can dynamically check another date
2. We would like to see the current year-to-date growth rate.
3. We would like to see that using Calcualte & DATESYTD () function
4. Call out any anomalies in the data as well as present any visuals that help them make better choices in the direction they want to take.

 

3 REPLIES 3
amitchandak
Super User
Super User

@Alex_Hasan , if you have date table marked as date table, then you can create a measure like example

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

 

refer if needed

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , what would be the dax for total sales here? Because I need to calculate it properly. 

Is it   SUM(Sales[Net Sales])? 

 

Capture.JPG

Hi   @Alex_Hasan , 

 

Did you want sum all the sales until the selected date?

Maybe you can try this measure to do that.

Measure = CALCULATE ( [Total sales], FILTER ( ALLSELECTED ( Dim_Date ), [Date] <= MAX ( 'Dim_Date'[Date] ) ) ) 

 

Best Regards
Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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