Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I'm trying to create a calculation group for multiple measures with following
1. Selected date & Previous date of selected date
2. Selected date's week & Previous week of selected date's week
3. Selected date's Month & previous Month of selected date's Month
Ex: if I pick Jan 22/2024 in date slicer, calc group should give me the values of Jan22, Jan 21, Week 4, week3, Jan 2024 and dec 2023 for total sales
Thank you
Solved! Go to Solution.
@01UmaManoharan , You can have following calculation item with help from date table
MTD Sales = CALCULATE(Selectedmeasure(),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(Selectedmeasure(),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(Selectedmeasure(),previousmonth('Date'[Date]))
this day =Selectedmeasure()
month behind = CALCULATE(Selectedmeasure(),dateadd('Date'[Date], -1, month)
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These items in calculationgroup can help
This Week = CALCULATE(Selectedmeasure(), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(Selectedmeasure(), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
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
Thak you Amit. I have got the solutions. This trick works!!
Thak you Amit. I have got the solutions. This trick works!!
@01UmaManoharan , You can have following calculation item with help from date table
MTD Sales = CALCULATE(Selectedmeasure(),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(Selectedmeasure(),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(Selectedmeasure(),previousmonth('Date'[Date]))
this day =Selectedmeasure()
month behind = CALCULATE(Selectedmeasure(),dateadd('Date'[Date], -1, month)
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These items in calculationgroup can help
This Week = CALCULATE(Selectedmeasure(), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(Selectedmeasure(), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |