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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
gameplane
Regular Visitor

Creating increase/decrease rate with irregular date column

I have ireegular date values. For example, data before 2023(2021,2021,etc.) only contains December data (integrated), and for 2023, only September and October exist. the cumulative population graph trend is drawn well, but I'm trying to see the rate of change by vomparing the values with the previous month's data, but the dax function doesn't work. It seems to be more difficult because the date values are not sequential. I just need to know the rate of change compared to the previous value of the existing date. Could you please five me some tips?

gameplane_0-1705323175085.png

I wort my own dax function. CurrentDate, currentPopulation, and PreviousDate are returnde well, but only the PreviousPopulation value is not returned well. Why?

 

---------------------------------------------------------------------------------------

Population Change Rate = 

VAR CurrentDate = SELECTEDVALUE('Table'[date])

VAR CurrentPopulation = CALCULATE(

    SUM('Table'[population])

    'Table'[date] = CurrentDate

)

VAR PreviousDate = CALCULATE(

    MAX('Table'[date])

    FILTER(

        ALL('Table'),

        'Table'[date] < CurrentDate

    )

)

VAR PreviousPopulation = CALCULATE(

    SUM('Table'[population]},

    'Table'[date] = PreviousDate

)

 

RETURN IF(

    NOT ISBLANK(PreviousPopulation),

    (CurrentPopulation - PreviousPopulation) / PreviousPopulation,

    BLANK()

)

------------------------------------------------------------------------------------------

Please understand that I am not good at English beacuse I am Korean.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.

 

Population Change Rate =
VAR CurrentDate =
    SELECTEDVALUE ( 'Table'[date] )
VAR CurrentPopulation =
    CALCULATE ( SUM ( 'Table'[population] ), 'Table'[date] = CurrentDate )
VAR PreviousDate =
    CALCULATE (
        MAX ( 'Table'[date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] < CurrentDate )
    )
VAR PreviousPopulation =
    CALCULATE (
        SUM ( 'Table'[population] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] = PreviousDate )
    )
RETURN
    IF (
        NOT ISBLANK ( PreviousPopulation ),
        ( CurrentPopulation - PreviousPopulation ) / PreviousPopulation,
        BLANK ()
    )

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.


Click here to visit my LinkedIn page

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.

 

Population Change Rate =
VAR CurrentDate =
    SELECTEDVALUE ( 'Table'[date] )
VAR CurrentPopulation =
    CALCULATE ( SUM ( 'Table'[population] ), 'Table'[date] = CurrentDate )
VAR PreviousDate =
    CALCULATE (
        MAX ( 'Table'[date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] < CurrentDate )
    )
VAR PreviousPopulation =
    CALCULATE (
        SUM ( 'Table'[population] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] = PreviousDate )
    )
RETURN
    IF (
        NOT ISBLANK ( PreviousPopulation ),
        ( CurrentPopulation - PreviousPopulation ) / PreviousPopulation,
        BLANK ()
    )

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.


Click here to visit my LinkedIn page

Thank you soooooooooo much!!!!!!!!!!!!!!!!!!!! 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.