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
gselvag
Helper I
Helper I

Period value (month over month change)

Hello gents,

 

I'm new to Power BI and have an issue regarding retreive/calculate period value (month). 

 

The datatable looks like this:

table_pbi.JPG

 

The column day_balance is ending balance value for each period. I have tried with a Measure calculation but it doesn't summerize column total.

 

Actual Days Period = 
VAR __PREV_MONTH = CALCULATE([Actual Days]; DATEADD('Calendar'[Date]; -1; MONTH))
RETURN
    IF ( ISBLANK([Actual Days]); BLANK(); [Actual Days] - __PREV_MONTH)

graph_pbi.JPG

 

 

How can I make a correct calculation period value based monthly "day_balance" value. Appreciate your assistance.

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @gselvag,

 

Please try this measure:

Actual Days Period =
VAR __PREV_MONTH =
    CALCULATE (
        [Actual Days],
        FILTER (
            ALLEXCEPT ( Table1, Table1[emp_no] ),
            Table1[period].[Year] = YEAR ( MAX ( Table1[period] ) )
                && Table1[period].[MonthNo]
                    = MONTH ( MAX ( Table1[period] ) ) - 1
        )
    )
RETURN
    IF ( ISBLANK ( [Actual Days] )BLANK (), [Actual Days] - __PREV_MONTH ) 

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @gselvag,

 

Please try this measure:

Actual Days Period =
VAR __PREV_MONTH =
    CALCULATE (
        [Actual Days],
        FILTER (
            ALLEXCEPT ( Table1, Table1[emp_no] ),
            Table1[period].[Year] = YEAR ( MAX ( Table1[period] ) )
                && Table1[period].[MonthNo]
                    = MONTH ( MAX ( Table1[period] ) ) - 1
        )
    )
RETURN
    IF ( ISBLANK ( [Actual Days] )BLANK (), [Actual Days] - __PREV_MONTH ) 

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Your measure work like a charm!
Thank You Yuliana

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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