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

Matrix for budget/actuals with different levels of ganularity

[Edited for clarity]

 

Hi all. Has anyone run into a case where actuals are recorded at one level and estimates at another?

 

I'm building a report for estimates to actuals, where the Estimates are at a project level, but the actuals are recorded at the activity level within project.

 

So, for example, the Estimate data looks like this:

 

JoborderNumberEstimatedCost
Job0001Order0001600
Job0001Order0002400
Job0002Order0003200

 

While the Actuals looks like this:

 

JoborderNumberActivityCodeActualCost
Job0001Order0001code-0001500
Job0001Order0001code-0001200
Job0001Order0001code-0002100
Job0001Order0002code-0001150
Job0001Order0002code-0001100
Job0002Order0003code-0002100
Job0002Order0003code-000250
Job0002Order0003code-000275

 

What I want the resulting matirx to look like is this:

 

 EstimateActual
Job000110001050
    Order0001600800
        code-0001-700
        code-0002-100
    Order0002400250
        code-0001-250
Job0002200225
    Order0003200225
        code-0002-225

 

Not this:

 

 EstimateActual
Job000110001050
    Order0001600800
        code-0001600700
        code-0002600100
    Order0002400250
        code-0001400250
Job0002200225
    Order0003200225
        code-0002200225

 

How can rollups be handled where the data does not actually exist at the lowest level?

 

Thanks.

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @dbk58 ,

For your requirement, you cannot create the relationship for the two tables.

And then you could create the measure below.

Measure =
IF (
    ISINSCOPE ( Actual[ActivityCode] ),
    BLANK (),
    IF (
        ISINSCOPE ( Actual[orderNumber] ),
        CALCULATE (
            SUM ( Estimate[EstimatedCost] ),
            FILTER (
                Estimate,
                Estimate[Job] = SELECTEDVALUE ( Actual[Job] )
                    && Estimate[orderNumber] = SELECTEDVALUE ( Actual[orderNumber] )
            )
        ),
        CALCULATE (
            SUM ( Estimate[EstimatedCost] ),
            FILTER ( Estimate, Estimate[Job] = SELECTEDVALUE ( Actual[Job] ) )
        )
    )
)

Here is the output.

Capture.PNG

You also could refer to my attachment.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @dbk58 ,

For your requirement, you cannot create the relationship for the two tables.

And then you could create the measure below.

Measure =
IF (
    ISINSCOPE ( Actual[ActivityCode] ),
    BLANK (),
    IF (
        ISINSCOPE ( Actual[orderNumber] ),
        CALCULATE (
            SUM ( Estimate[EstimatedCost] ),
            FILTER (
                Estimate,
                Estimate[Job] = SELECTEDVALUE ( Actual[Job] )
                    && Estimate[orderNumber] = SELECTEDVALUE ( Actual[orderNumber] )
            )
        ),
        CALCULATE (
            SUM ( Estimate[EstimatedCost] ),
            FILTER ( Estimate, Estimate[Job] = SELECTEDVALUE ( Actual[Job] ) )
        )
    )
)

Here is the output.

Capture.PNG

You also could refer to my attachment.

Best Regards,

Cherry

 

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