Reply
datagorillagirl
Microsoft Employee
Microsoft Employee
Partially syndicated - Outbound

null

null

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Syndicated - Outbound

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1664260656918.png

 

 

Expected measure: =
VAR _newtable =
    ADDCOLUMNS (
        Data,
        "@HC", CALCULATE ( SUM ( Data[Ending HC] ) ),
        "@HCprevmonth",
            CALCULATE (
                SUM ( Data[Ending HC] ),
                FILTER (
                    ALL ( Data ),
                    Data[Fiscal Month ID]
                        = EARLIER ( Data[Fiscal Month ID] ) - 1
                )
            )
    )
VAR _monthcount =
    COUNTROWS ( Data )
RETURN
    DIVIDE ( SUMX ( _newtable, [@HC] + [@HCprevmonth] ), _monthcount * 2 )

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.

Syndicated - Outbound

Do you have an alternative to the earlier function as that does not work

Syndicated - Outbound

Hi,

Please try the below, and check the attached file.

 

Expected measure V2: =
VAR _newtable =
    ADDCOLUMNS (
        Data,
        "@HC", CALCULATE ( SUM ( Data[Ending HC] ) ),
        "@HCprevmonth",
            CALCULATE (
                SUMX (
                    FILTER (
                        ALL ( Data ),
                        Data[Fiscal Month ID]
                            = MAX ( Data[Fiscal Month ID] ) - 1
                    ),
                    Data[Ending HC]
                )
            )
    )
VAR _monthcount =
    COUNTROWS ( Data )
RETURN
    DIVIDE ( SUMX ( _newtable, [@HC] + [@HCprevmonth] ), _monthcount * 2 )

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.

Syndicated - Outbound

It works in the pbix file but getting odd results in my measure

Syndicated - Outbound

Hi,

Please share your sample pbix file's link.

Thanks.

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.

avatar user

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.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)