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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors