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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
acorcos
New Member

Help with same period, but the month is not finished

Hello community, I have tried some solutions that I saw but I got no success.

I have a simple table with DATE, COUNT and TKT_TYPE

Date = its a day, like 01/01/2021

Tkt_Type = There are two values here, System or Network

Count = total tickets opened on that day

Here how the table looks

Date | Count | Tkt_type

01/01/2021 | 5 | System

01/01/2021 | 3 | Network

02/01/2021 | 4 | System

02/01/2021 | 8 | Network

....

 

I need two infos:

1) Total tickets by type on this month (It works)

TTMMATUALSYS = TOTALMTD(SUM(AC_TKTBYMM[COUNT]),AC_TKTBYMM[DATE],AC_TKTBYMM[TKT_TYPE]="System")
TTMMATUALNET = TOTALMTD(SUM(AC_TKTBYMM[COUNT]),AC_TKTBYMM[DATE],AC_TKTBYMM[TKT_TYPE]="Network")
 
2) And now I need same result, but at the same period of last year. Today is 07/09/2021 so, i need from 01/09/2020 to 07/09/2020
I tried this
TTMMPASSSYS = TOTALMTD(SUM(AC_TKTBYMM[COUNT]),SAMEPERIODLASTYEAR(AC_TKTBYMM[DATE]),(AC_TKTBYMM[TKT_TYPE]="System"))
but the result is for all month.
 
Can please anyone help?
Thanks
8 REPLIES 8
acorcos
New Member

Just got same result till here, all month of sep/2020

 

Going to the oracle database, i run this:

SELECT SUM(COUNT) FROM AC_TKTBYMM WHERE DATE>=to_date('01/09/2020','DD/MM/YYYY') and DATE<=to_date('07/09/2020','DD/MM/YYYY') and tkt_Type='System'

The result is 24

 

If i just change the date 07/09/2020 to 30/09/2020 i got 147.

 

All tries till here show 147 on card

CNENFRNL
Community Champion
Community Champion

Use a date table if you want to make the best of time intelligence functions,

TTMMPASSSYS =
CALCULATE(
    SUM( AC_TKTBYMM[COUNT] ),
    DATEADD( DATESMTD( DATES[Date] ), -1, YEAR ),
    AC_TKTBYMM[TKT_TYPE] = "System"
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Tanushree_Kapse
Impactful Individual
Impactful Individual

@acorcos ,

SalesMTDLastYear =
CALCULATE ( TTMMATUALSYS, SAMEPERIODLASTYEAR ( AC_TKTBYMM[DATE] ) )


SalesMTDLastYear2 = CALCULATE ( TTMMATUALNET, SAMEPERIODLASTYEAR ( AC_TKTBYMM[DATE] ) )

 

Anonymous
Not applicable

Hi @acorcos 

can you try this?

TTMMPASSSYS = CALCULATE(TOTALMTD(SUM(AC_TKTBYMM[COUNT]),(AC_TKTBYMM[DATE]),(AC_TKTBYMM[TKT_TYPE]="System")),SAMEPERIODLASTYEAR(AC_TKTBYMM[DATE]))

 

Regards,

Aditya

Hi!

I got same result of all month

Thanks

Anonymous
Not applicable

Can you please try with,

TTMMPASSSYS = CALCULATE(TOTALMTD(SUM(AC_TKTBYMM[COUNT]),(AC_TKTBYMM[DATE]),(AC_TKTBYMM[TKT_TYPE]="System")),PARALLELPERIOD(AC_TKTBYMM[DATE],-1,YEAR))
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @acorcos ,

 

Please try below measure:
PreviousyrMTD(System)=  CALCULATE(TTMMATUALSYS ,PARALLELPERIOD(AC_TKTBYMM[DATE], -12, MONTH)

PreviousyrMTD(Network)= CALCULATE(TTMMATUALNET ,PARALLELPERIOD(AC_TKTBYMM[DATE], -12, MONTH)

 

 

I hope this helps!
Mark this as a solution, if it answered your question. Kudos are always appreciated.

Thanks!

Hello! Thanks, but the results show all month of sep/2020.

I just need sep/2020 but the end date must be same as today (07/09/2020)

 

🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.