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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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

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

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.