Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
cisyncllc
Frequent Visitor

Calculating Month to month Change by month and partial days in the month

my secnario is I am counting totals of previous month totals over current month totals but I only want to compare forexample Feb 1st -15th over Jan 1st - 15th.  I have Year filter, Month filter and Day Filter on my dashboard and by using samperiod calculation it works by year and month (full days) but when I start comparing by day its not working.

 

Count Current = distinctCOUNT(lwmain[inci_id])

 

****   Code previous= CALCULATE([Code Count_Distinct],  PARALLELPERIOD('Calendar'[Date], -1, MONTH))

 

Diff 4 = [Code Count_Distinct] - [Code Count4_4]

Month visual 

cisyncllc_0-1644966382204.png

 

Visual when day filter is applied

cisyncllc_1-1644966539131.png

Please help

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @cisyncllc ,

 

Here's my solution.

If your current month count measure is correct, simply use the PREVIOUSMONTH function.

PreviousMonthCount = CALCULATE([CurrentMonthCount],PREVIOUSMONTH('Calendar'[Date]))

vstephenmsft_0-1645173394364.png

 

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @cisyncllc ,

 

Here's my solution.

If your current month count measure is correct, simply use the PREVIOUSMONTH function.

PreviousMonthCount = CALCULATE([CurrentMonthCount],PREVIOUSMONTH('Calendar'[Date]))

vstephenmsft_0-1645173394364.png

 

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@cisyncllc , Try like

_max can be today or selected date in slicer maxx(allselected('Date'),'Date'[date])

 


MTD QTY forced=
var _max = today()
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALMTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))


LMTD QTY forced=
var _max = date(year(today()),month(today())-1,day(today()))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you I treid your solution however it did not give the expected results please see attached visual.

 

cisyncllc_0-1645023511087.png

 

Filters: "Day" is Day Number.  

cisyncllc_0-1645024264434.png

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.