The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
i looked an 10+ threads but none seems to do the trick for me....
I have labour costs which are varrying every month.
So i want to build an KPI which is comparing this month and the previous month.
for that I need a DAX which goes kind of like
Solved! Go to Solution.
Try with a date calendar
MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(dateadd('Date'[Date],-1,MONTH)))
training MTD Sales = CALCULATE([40014 Costs of rented employees],(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(dateadd('Date'[Date],-12,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos.
@Anonymous
Change a bit in the FILTER, and stick with your formula:
This month = CALCULATE([40014 Costs of rented employees]; FILTER('Accounting Date'; MONTH([Date])=MONTH(TODAY())))
Previous month = CALCULATE([40014 Costs of rented employees]; FILTER('Accounting Date'; MONTH([Date])=MONTH(TODAY())-1))
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try with a date calendar
MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(dateadd('Date'[Date],-1,MONTH)))
training MTD Sales = CALCULATE([40014 Costs of rented employees],(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales = CALCULATE([40014 Costs of rented employees],DATESMTD(dateadd('Date'[Date],-12,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos.
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |