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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ScarlettBebb
Frequent Visitor

Previous Month showing blank (percent difference calculation)

Hello all,

 

I was wondering if anyone could help with this error? I have a table as follows

 

ScarlettBebb_1-1666271584626.png

 

From this I created a series of measures like this 

 

Average FPA = AVERAGE('Product FPA'[FPA])
Prior Month FPA = CALCULATE([Average FPA], PREVIOUSMONTH('Product FPA'[Attribute].[Date]))
% Change = DIVIDE([Average FPA], [Prior Month FPA], blank())-1

 

 

Then I wanted to make a table visual to show me the %change of FPA month to month for each product. But the previous month shows as Blank (and I've tried changing data hierchy). See visual below. I think the % change doesn't work yet because of the previous month error. I don't know if this makes a difference but my Date is the 01st of every month from 2016 to 2022. 

 

ScarlettBebb_2-1666271796646.png

 

Any help would be really appreciated 

 

Thank you 

 

Scarlett

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

If you do not have DIM-calendar table, one of ways to achieve this is to create a measure like below.

I tried to create a sample pbix file like below, and I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1666273026125.png

 

 

Prior month value avg: =
CALCULATE (
    [Value avg:],
    'Table'[Attribute]
        = MAXX (
            FILTER (
                ALLSELECTED ( 'Table'[Attribute] ),
                'Table'[Attribute] < MAX ( 'Table'[Attribute] )
            ),
            'Table'[Attribute]
        )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

If you do not have DIM-calendar table, one of ways to achieve this is to create a measure like below.

I tried to create a sample pbix file like below, and I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1666273026125.png

 

 

Prior month value avg: =
CALCULATE (
    [Value avg:],
    'Table'[Attribute]
        = MAXX (
            FILTER (
                ALLSELECTED ( 'Table'[Attribute] ),
                'Table'[Attribute] < MAX ( 'Table'[Attribute] )
            ),
            'Table'[Attribute]
        )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thank you so much! This worked perfectly 

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.