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
IfaZ_1
Helper I
Helper I

How to Calculate Previous Month

Hi, I'm trying to calculate the previous month tickets using previousmonth function but it is showing blank. I'm not sure what is wrong. Pleaseeeee help me outttt 😥

IfaZ_1_0-1725604358237.png

 

my desired out put would be:

 

IfaZ_1_1-1725604447397.png

 

link of the dashboard: https://we.tl/t-c1KCSIintH

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @IfaZ_1 ,

 

Try the expression:

vtianyichmsft_0-1725861743169.png

MoM Total Ticket = var _t = ADDCOLUMNS('Page 1',"Pre",SUMX(FILTER(ALL('Page 1'),YEAR([Date])=YEAR(EARLIER([Date]))&&[MonthNum]=EARLIER([MonthNum])-1),[Total Tickets]))
RETURN MAXX(_t,[Pre])

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

3 REPLIES 3
bhanu_gautam
Super User
Super User

@IfaZ_1 , First make sure you have one separate date table for this then use PREVIOUSMONTH and reference date table date and create relation with your table

 

PreviousMonthTickets =
CALCULATE(
COUNTROWS(TicketsTable),
PREVIOUSMONTH(DateTable[Date])
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Why COUNTROWS? I have make a measure of total tickets. 

IfaZ_1_0-1725759817768.png

 

Anonymous
Not applicable

Hi @IfaZ_1 ,

 

Try the expression:

vtianyichmsft_0-1725861743169.png

MoM Total Ticket = var _t = ADDCOLUMNS('Page 1',"Pre",SUMX(FILTER(ALL('Page 1'),YEAR([Date])=YEAR(EARLIER([Date]))&&[MonthNum]=EARLIER([MonthNum])-1),[Total Tickets]))
RETURN MAXX(_t,[Pre])

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

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.

Top Solution Authors