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
DannyMiletic
Frequent Visitor

Cant Add Prior Year Revenue by Account to Matrix

Hi - I need help with the right dax measure/column to get the PY Actuals to report correctly in this matrix with the Actuals slicer.

I got the prior year Actuals in the Actuals Table and can see the correct prior year amount correctly but can't get it correct added as  a column in the report. Also why is the total for PY_Actuals showing the sae amount as th elast line and why doesn't it sum correctly? Any help appreciated here.

 

DannyMiletic_1-1680016251620.png

 

 

DannyMiletic_0-1680016041512.png

 

2 ACCEPTED SOLUTIONS
DannyMiletic
Frequent Visitor

Also can's seem to get the current year and PY actuals by date to summarize into total aggregates by month.

View solution in original post

Hi @DannyMiletic ,

Please follow the steps below and check if it can return your expected result.

1. Update the formula of measure [PY Actuals] as below

PY Actuals =
VAR _seldate =
    SELECTEDVALUE ( Actuals[Date] )
VAR _selamount =
    SELECTEDVALUE ( Actuals[Account] )
VAR _pre =
    DATE ( YEAR ( _seldate ) - 1, MONTH ( _seldate ), DAY ( _seldate ) )
RETURN
    CALCULATE (
        SUM ( Actuals[Value] ),
        FILTER (
            ALLSELECTED ( Actuals ),
            Actuals[Date] = _pre
                && Actuals[Account] = _selamount
        )
    )

2. Create a measure as below base on the measure [PY Actuals] and put this new measure on your matrix visual to replace the original measure [PY Actuals]

Measure =
SUMX (
    GROUPBY ( Actuals, Actuals[United States], Actuals[Account] ),
    [PY Actuals]
)

Best Regards

Community Support Team _ Rena
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
DannyMiletic
Frequent Visitor

Also can's seem to get the current year and PY actuals by date to summarize into total aggregates by month.

Hi @DannyMiletic ,

Please follow the steps below and check if it can return your expected result.

1. Update the formula of measure [PY Actuals] as below

PY Actuals =
VAR _seldate =
    SELECTEDVALUE ( Actuals[Date] )
VAR _selamount =
    SELECTEDVALUE ( Actuals[Account] )
VAR _pre =
    DATE ( YEAR ( _seldate ) - 1, MONTH ( _seldate ), DAY ( _seldate ) )
RETURN
    CALCULATE (
        SUM ( Actuals[Value] ),
        FILTER (
            ALLSELECTED ( Actuals ),
            Actuals[Date] = _pre
                && Actuals[Account] = _selamount
        )
    )

2. Create a measure as below base on the measure [PY Actuals] and put this new measure on your matrix visual to replace the original measure [PY Actuals]

Measure =
SUMX (
    GROUPBY ( Actuals, Actuals[United States], Actuals[Account] ),
    [PY Actuals]
)

Best Regards

Community Support Team _ Rena
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.