Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
can anyone help me with DAX.
this is the actual data i have
i need help to create a measure that if user choose the date it will calculate the different of cummulative quantity sold between selected date and previous year. example if user select the december 2022, it will pick 3500 (from november 2022, because december 2022 not available) - 1785 (from december 2021)
another example to make it clear : if user choose august 2022, so it will pick 3150 (from may 2022) - 350 (From march 2021)
totally blank on how to achieve that, i create cummulative using calculated column.
thanks
regards,
Sind
Solved! Go to Solution.
@wsindharta , Are looking for YTD over YTD ?
eith help from date table
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
diff = [YTD Sales]-[Last YTD Sales]
diff % = divide([YTD Sales]-[Last YTD Sales]],[Last YTD Sales])
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
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
@wsindharta , Are looking for YTD over YTD ?
eith help from date table
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
diff = [YTD Sales]-[Last YTD Sales]
diff % = divide([YTD Sales]-[Last YTD Sales]],[Last YTD Sales])
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |