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 September 15. Request your voucher.
Hello all!
Im trying to create a measure that calculates the difference between this months (FloatDays) and Last months
below is the table im using just a simple calculation like (ThisMonthsFloatTotal - LastMonthsFloatTotal)
for some reason im struggling to make this in power bi
any suggestions?
Thank you in advance!!
Solved! Go to Solution.
Hi, @yazenbarakat123
Please try the following mesaures:
Last months =
CALCULATE (
MAX ( 'Table'[FloatDays] ),
FILTER (
ALL ( 'Table' ),
'Table'[ActivityID] = MAX ( 'Table'[ActivityID] )
&& 'Table'[Month] = EDATE ( MAX ( 'Table'[Month] ), -1 )
)
)
Resilt = IF(ISBLANK('Table'[Last months]),BLANK(), MAX('Table'[FloatDays])-'Table'[Last months])
Best Regards,
Community Support Team _ Eason
Hi, @yazenbarakat123
Please try the following mesaures:
Last months =
CALCULATE (
MAX ( 'Table'[FloatDays] ),
FILTER (
ALL ( 'Table' ),
'Table'[ActivityID] = MAX ( 'Table'[ActivityID] )
&& 'Table'[Month] = EDATE ( MAX ( 'Table'[Month] ), -1 )
)
)
Resilt = IF(ISBLANK('Table'[Last months]),BLANK(), MAX('Table'[FloatDays])-'Table'[Last months])
Best Regards,
Community Support Team _ Eason
@yazenbarakat123 , You can use time intelligence with date table
examples
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))
this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
User | Count |
---|---|
15 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |