Forum Discussion

xozelda11's avatar
xozelda11
Icon for Helper I rankHelper I
1 year ago
Solved

Not summing up total correctly for this column

When pivotal export = yes, it sums up the total correctly for this column, but when pivotal export = no, it does not sum of the total correctly.

 

This is my measure I created

Incremental EBITDA Contribution =
SUMX(
  'Dim Project Metrics',
 
  VAR VolVar   = [Sales Volume Variance]
  VAR IsExport = 'Dim Project Metrics'[Pivotal Export Check] = "Yes"
 
  VAR Rate =
    IF(
      IsExport,
      // Export-Prime (pinned to 2025) – unchanged
      CALCULATE(
        [EBITDA - Forecast (cpp)],
        FILTER(
          ALL( 'Dim Project Metrics' ),
          'Dim Project Metrics'[finance grouping] = "export-prime"
          && 'Dim Project Metrics'[market role]    = "pivotal"
        ),
        KEEPFILTERS( VALUES( 'Dim Asset'[Asset Name] ) ),
        KEEPFILTERS( VALUES( 'Dim Date'[Date].[Month] ) ),
        'Dim Date'[Year] = 2025
      ),
      // Domestic-Prime – simplified to a single grouping filter
      CALCULATE(
        [EBITDA - Forecast (cpp)],
        FILTER(
          'Dim Project Metrics',
          'Dim Project Metrics'[finance grouping] = "domestic-prime"
        )
      )
    )
 
  RETURN
    VolVar * Rate
)


can anyone help me fix the formula so that when pivotal export = no, it sums up the total correclty?

10 Replies

  • Hi xozelda11 

    Please try this one:

    Incremental EBITDA Contribution =
    SUMX(
        'Dim Project Metrics',
        VAR VolVar = [Sales Volume Variance]
        VAR IsExport = 'Dim Project Metrics'[Pivotal Export Check] = "Yes"
        
        VAR Rate =
            IF(
                IsExport,
                // Export-Prime (pinned to 2025) – unchanged
                CALCULATE(
                    [EBITDA - Forecast (cpp)],
                    FILTER(
                        ALL('Dim Project Metrics'),
                        'Dim Project Metrics'[finance grouping] = "export-prime"
                        && 'Dim Project Metrics'[market role] = "pivotal"
                    ),
                    KEEPFILTERS(VALUES('Dim Asset'[Asset Name])),
                    KEEPFILTERS(VALUES('Dim Date'[Date].[Month])),
                    'Dim Date'[Year] = 2025
                ),
                // Domestic-Prime - corrected to maintain proper context
                CALCULATE(
                    [EBITDA - Forecast (cpp)],
                    FILTER(
                        ALL('Dim Project Metrics'),
                        'Dim Project Metrics'[finance grouping] = "domestic-prime"
                    ),
                    KEEPFILTERS(VALUES('Dim Asset'[Asset Name])),
                    KEEPFILTERS(VALUES('Dim Date'[Date].[Month]))
                )
            )
        
        RETURN
            VolVar * Rate
    )

    or this a more streamlined approach

    Incremental EBITDA Contribution =
    SUMX(
        'Dim Project Metrics',
        VAR VolVar = [Sales Volume Variance]
        VAR Rate = 
            CALCULATE(
                [EBITDA - Forecast (cpp)],
                FILTER(
                    ALL('Dim Project Metrics'),
                    'Dim Project Metrics'[finance grouping] = 
                        IF('Dim Project Metrics'[Pivotal Export Check] = "Yes", 
                           "export-prime", 
                           "domestic-prime")
                    && ('Dim Project Metrics'[Pivotal Export Check] = "No" 
                        || 'Dim Project Metrics'[market role] = "pivotal")
                ),
                KEEPFILTERS(VALUES('Dim Asset'[Asset Name])),
                KEEPFILTERS(VALUES('Dim Date'[Date].[Month]))),
                IF('Dim Project Metrics'[Pivotal Export Check] = "Yes", 'Dim Date'[Year] = 2025, TRUE)
            )
        RETURN
            VolVar * Rate
    )

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

    Thank you.

      • Elena_Kalina's avatar
        Elena_Kalina
        Icon for Solution Sage rankSolution Sage

        Hi, when I tryed to open link I got error message that access to this document has been removed

  • Hi xozelda11 

    Thanks for sharing the screenshots! To better understand your issue and provide more accurate assistance, could you share a sample file (PBIX or PBIT) with dummy data that replicates the problem? This way, I can see the underlying structure, measures, or relationships causing the issue.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi xozelda11 
    Thank you for reaching out microsoft fabric community forum.
    As Elena_Kalina mentioned could you please provide sample pbix file so that we might assist you more effiently.
    Thank you.

    • xozelda11's avatar
      xozelda11
      Icon for Helper I rankHelper I

      How do you attach a sample power bi?

  • v-prasare's avatar
    v-prasare
    Icon for Community Support rankCommunity Support

    Hi xozelda11,

    I’m following up on our previous communication regarding your issue. To proceed with the investigation, we kindly requested a sample dataset that reproduces the problem. As of now, we haven’t received the required sample. Please share it at your earliest convenience so we can assist you further. 

     

    If we don’t hear back, we’ll go ahead and close this thread. For any further discussions or questions, please start a new thread in the Microsoft Fabric Community Forum  we’ll be happy to assist.

     

    Thank you for being part of the Microsoft Fabric Community.

  • v-prasare's avatar
    v-prasare
    Icon for Community Support rankCommunity Support

    As we don’t hear back, we’ll go ahead and close this thread. For any further discussions or questions, please start a new thread in the Microsoft Fabric Community Forum we’ll be happy to assist.


    Thank you for being part of the Microsoft Fabric Community.