The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
hello,
im trying to create a masure that calculates for example number of orders in Week2 in this month and total orders in the same week number ( Week 2) in the previous month.
then i want to calculate Peiod on Period by this formula : (( Total orders in the selected week number- total orders in the same week number last month)/total orders in the same week number last month).
@lawada , create a month week
Start Month = STARTOMONTH('Date'[Date])
Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1
now you can measure like
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]), filter(Date,date[Month Week] =2))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)),, filter(Date,date[Month Week] =2))
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |