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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Lorentzt
Frequent Visitor

How to create columns based on time created but in groups (This year, this month, last month)

Hello.

 

Today i have a presentation of solution time (0-2,2-5,5-10 and more than 10 days) for tickets.

Each column is created by 4 measures. Like this for 2 Days: count2 = CALCULATE(counta('SO_TICKET'[2510D]),filter(all('SO_TICKET'[2510D]),'SO_TICKET'[2510D]=2))

Using the ticket created.date to show this in monthly or yearly columns:

PBI-solution times.PNG 

 

We would like to change the presentation so the columns instead show:

  • Current Month
  • Last Month
  • This year
  • Last Year

 

Any sugestions on how to solve this would be welcome.

 

Possible solutions?

  • Create one measure for each time periode using the original Measure and a date filter check.
  • Create a column filter for this 4 periodes

How to do it though is the challenge

2 REPLIES 2
BalaVenuGopal
Resolver I
Resolver I

Hi @Lorentzt ,

 

you need to create 4 measures

 Curr Month = CALCULATE(counta('SO_TICKET'[2510D]),filter(your table name),Month(Your Date Colum) = Month(GetDate())

LIke wise you can create measures.

 

Hope this will resolve your isseu

 

Plese mark as solution if this works for you.

 

Thanks for the help. I removed a ( and added a check for year (so i wouldnt get for that month in all years)

 

CurrYear = CALCULATE(counta('SO_TICKET'[2510D]),filter(SO_TICKET,YEAR(SO_TICKET[Created.Date]) = YEAR(TODAY())))

 

This gives me 238 that is the same ammount the 4 measures i have count up to if filtered on date for year :).

 

But how can i use this further?

Do i have to create 4 measures for each time periode as below? But then how do i manage to get that presented in 4 columns?

 

CurrMonthD2 = CALCULATE(counta('SO_TICKET'[2510D]),filter(SO_TICKET,Month(SO_TICKET[Created.Date]) = MONTH(TODAY())),SO_TICKET,YEAR(SO_TICKET[Created.Date]) = YEAR(TODAY()),SO_TICKET,SO_TICKET[2510D] = 2)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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