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 error on rolling 12 month calculated column

Hi Experts

 

I cannot work out where i am going wrong with the following rolling 12 months measure. See calculate column measure i would like to keep the current measure and amend if possible...

 

For Jan 19 The result is correct 60%

 

For Feb 19 The result is worng and should be the Sum of (81,788,374+94393580) / (135,605,381 + 137602264) = 64%

not (94393580) / (137602264) which the measure is returning. 

 

See expected result in excel image

 

Capture.PNG

 

Sample PBIX

 

 

 

 

 

 

 

 

 

 

 

Sample Data

https://www.dropbox.com/s/e280kz8rl9x0i4u/SSAMPLE.pbix?dl=0

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

The result for row 8 should be 64.15%.

(81,788,374+94,393,580+98,235,790)/(135,605,381+137,602,264+154,585,590)=0.6415

Column =
VAR _res =
    CALCULATE (
        SUM ( 'Llo_DIR_Data'[Result] ),
        FILTER (
            'Llo_DIR_Data',
            [Date] <= EARLIER ( Llo_DIR_Data[Date] )
                && [New Month] = EARLIER ( Llo_DIR_Data[New Month] )
        )
    )
VAR _apps =
    CALCULATE (
        SUM ( 'Llo_DIR_Data'[Apps in Month/Term] ),
        FILTER (
            'Llo_DIR_Data',
            [Date] <= EARLIER ( Llo_DIR_Data[Date] )
                && [New Month] = EARLIER ( Llo_DIR_Data[New Month] )
        )
    )
RETURN
    DIVIDE ( _res, _apps )

7.png

 

I filtered out the blanks in the Power Query editor beforehand.

9.png

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
lbendlin
Super User
Super User

You mention that you want a measure but your sample PBIX has a calculated column.  Please clarify.

 

The source data is a bit confusing. Can you maybe show the expected result for row 8 ?

Anonymous
Not applicable

Apologies i want to keep the calculated column measure....result for row 8 is 64.73

Hi @Anonymous ,

 

The result for row 8 should be 64.15%.

(81,788,374+94,393,580+98,235,790)/(135,605,381+137,602,264+154,585,590)=0.6415

Column =
VAR _res =
    CALCULATE (
        SUM ( 'Llo_DIR_Data'[Result] ),
        FILTER (
            'Llo_DIR_Data',
            [Date] <= EARLIER ( Llo_DIR_Data[Date] )
                && [New Month] = EARLIER ( Llo_DIR_Data[New Month] )
        )
    )
VAR _apps =
    CALCULATE (
        SUM ( 'Llo_DIR_Data'[Apps in Month/Term] ),
        FILTER (
            'Llo_DIR_Data',
            [Date] <= EARLIER ( Llo_DIR_Data[Date] )
                && [New Month] = EARLIER ( Llo_DIR_Data[New Month] )
        )
    )
RETURN
    DIVIDE ( _res, _apps )

7.png

 

I filtered out the blanks in the Power Query editor beforehand.

9.png

 

 

Best Regards,

Stephen Tao

 

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.