Forum Discussion

CarlsBerg999's avatar
CarlsBerg999
Helper V
4 years ago
Solved

Propagating an ID

Hi,

 

I'm having difficulties creating a Calculated Column for a scenario: The goal is to create a dax for the result column. 

Each platform has atleast 1 Indicator markek as "X". If there are multiple "X"'s, the ID2 is the same for these items.


I want to propagate the indicated ID2 to all results in the same platform. Therefore, all rows in Platform 123 have Result of 531 and all rows in platform 321 have a result of 510.

 

My current dax is faulty:   
CALCULATE(MAX(ID2),
PLATFORM = EARLIER(PLATFORM),

INDICATOR = "X")

 

This does not propagate the correct result to all rows, only the rows that have an indicator. Any ideas?

 

PlatformID2IndicatorResult
123514 531
12354 531
123531X531
123  531
32115 510
321510X510
321510X510
3215 510
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi CarlsBerg999 ,

    You can update the formula of your calculated column [Result] as below:

    Result = 
    CALCULATE (
        MAX ( 'Table'[ID2] ),
        FILTER (
            'Table',
            'Table'[Platform] = EARLIER ( 'Table'[Platform] )
                && 'Table'[Indicator] = "X"
        )
    )

    If the above one can't help you get the desired result, please provide more sample data(exclude sensitive data) and the correct result with backend logic and special examples. Thank you.

    Best Regards

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi CarlsBerg999 ,

    You can update the formula of your calculated column [Result] as below:

    Result = 
    CALCULATE (
        MAX ( 'Table'[ID2] ),
        FILTER (
            'Table',
            'Table'[Platform] = EARLIER ( 'Table'[Platform] )
                && 'Table'[Indicator] = "X"
        )
    )

    If the above one can't help you get the desired result, please provide more sample data(exclude sensitive data) and the correct result with backend logic and special examples. Thank you.

    Best Regards