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.
How to check whether the given month with year value column contain previous month or not in power bi ?
@Anonymous , With Time intelligence this way to know last month , this need date table
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]))
With Help of Date, or a month year Table( Having rank on YYYYMM)
Month Rank = RANKX(all('Date'),'Date'[Year Month],,ASC,Dense)
This Month = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])))
Last Month = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])-1))
If you need last on only in this year, again separate date or month year table
This Month = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && Date[Month]=max(Date[Month])))
last Month only This year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && Date[Month]=max(Date[Month])-1 ))
@Anonymous
could you pls provide the sample data and expected output?
Proud to be a Super User!