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

Previous Month Calculation

Hi, 

 

I'm running a the end of blocked road here. I have tried several times and still my calculation didnt appear. 

this is the calculation I made : 

MoM Total Ticket =
    CALCULATE(
        [Total Tickets],
        PREVIOUSMONTH('FY Date'[Date])
    )
 
The result and my relationship tables
IfaZ_1_0-1725853906063.pngIfaZ_1_1-1725853957744.png

 

9 REPLIES 9
v-tangjie-msft
Community Support
Community Support

Hi @IfaZ_1 ,

 

Thanks to Irwan , Dangar332  and some_bih for their quick replies. I have some other thoughts to add:

(1) We can create a column on [FY Date] table.

Month_num = MONTH([Date])

(2) We can create a measure.

MoM Total Ticket = 
    CALCULATE(
        [Total Tickets],
        FILTER(ALL('FY Date'),[Month_num]=MAX('FY Date'[Month_num])-1)
    )

vtangjiemsft_0-1725958249800.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Dangar332
Super User
Super User

HI, @IfaZ_1 

Try below measure

MoM Total Ticket =
var previous_month = maxx(
filter(
all('FY Date'[Month]),
'FY Date'[Month]<min('FY Date'[Month])
))
return
 CALCULATE(
        [Total Tickets],
        'FY Date'[Month]=previous_month
    )

 

Best Regards,
Dangar

 

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

 

Hi Dangar, 

 

It is giving me this error 

 

IfaZ_1_0-1725862351693.png

 

MoM Total Ticket =
var previous_month = maxx(
filter(
all('FY Date'[Month]),
'FY Date'[Month]<min('FY Date'[Month])
),'FY Date'[Month])
return
 CALCULATE(
        [Total Tickets],
        'FY Date'[Month]=previous_month
    )

Hi Dangar, 

 

It is showing blank

IfaZ_1_0-1725864069003.png

 

Irwan
Memorable Member
Memorable Member

hello @IfaZ_1 

 

i downloaded your sample file in your other post couple days ago.

 

i was meant to ask you, is there any reason you collect month from 'Page 1' tbl?

 

if you take month value from 'FY Date' tbl, you can see the result already.

Irwan_2-1725939716185.png

for your record, i didnt change any DAX, only change month value from 'Page 1' tbl to 'FY Date' tbl.

 

MoM SLA or MoM Totak Ticket use time intellegence value from 'FY Date' tbl so it might be the issue why it shows no value (i am not sure on this, but it does show the previous value).

Irwan_3-1725939932386.png

 

 

Hope this will help.
Thank you.

Because if I use the FY table my tickets number is not the same. 

 

IfaZ_1_0-1726209261300.png

 

some_bih
Super User
Super User

Hi @IfaZ_1 share measure definition for  [Total Tickets]





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






here is my measure for
 
Total Tickets = SUM('Page 1'[DNME]) + SUM('Page 1'[SLAEE]) + SUM('Page 1'[Open]) + SUM('Page 1'[SLAME])

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.