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
Anonymous
Not applicable

Measure for previous period in KPI Card

Hi,

 

I need to show the current period and previous period as KPIs. How do I create the measure for the previous period?

For Current period I used 

Current Period = Calculate(sum(Amount), Filter( Table[Reporting Period] = Max(Reporting Period])

Previous Period = ??

 

From a performance perspective is there a better way to get the Current period measure? Filter interates should the entire table ?

Can use a variable and have VAR MaxPeriod = Max(Reporting Period) and use this in the Calculate function?

thanks for looking into this.

 

7 REPLIES 7
bfernandez
Resolver II
Resolver II

What are the periods you are looking for?

 

There are a few things you can do including:

 

  • Create a calculation using the SAMEPERIODLASTYEAR to calculate against the Current Period you are looking at
  • You can use Quick Measures to calculate time intelligent information.
    • MoM
    • YoY
    • Year-to-date
    • Etc.

Let me know if any of these solutions help, if not we can work through some other solutions but these are a quick way to get what you're looking for.

Anonymous
Not applicable

Thanks for your reply. 

The current period is Jan 2020 and I previous period is Dec 2019. 

How do I calculate the the measure for Dec 2019?

This can be accomplished by using the PREVIOUSMONTH DAX function.

 

It should look something like this:

=CALCULATE(SUM(Amount), PREVIOUSMONTH(Table[Reporting Period]))

Anonymous
Not applicable

HI @bfernandez 

 

This will not work in a KPI card

dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

 

Anonymous
Not applicable

Hi @dax 

 

That was very useful. Let me try it out

But why do we have to use 

FILTER(ALLEXCEPT('Table','Table'[KPIS])
 
 
dax
Community Support
Community Support

Hi @Anonymous ,

You could think this as calculate based on KPI group. And you also could refer to allexcept-function-dax  for more details.

Best Regards,
Zoe Zhi

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

 

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.