Forum Discussion

BrianNeedsHelp's avatar
BrianNeedsHelp
Icon for Resolver I rankResolver I
1 year ago
Solved

CONCATENATEX the Column Header if 0 found in Row

I have a matrix table like this:   Location     Device1     Device2     Device3     Concatenate A 1 0 0 Device2, Device3 B 0 4 5 Device1 C 0 0 3 Device1,Device2 D 1 ...
  • MohamedFowzan1's avatar
    1 year ago

    Hi BrianNeedsHelp 

     

    Could you try this, I recreated your scenario and it seemed to work:

    DevicesNeeded = 
    VAR DeviceList = {
        IF(IOH[Device1] = 0, "Device1", BLANK()),
        IF(IOH[Device2] = 0, "Device2", BLANK()),
        IF(IOH[Device3] = 0, "Device3", BLANK())
    }
    VAR FilteredDevices = FILTER(DeviceList, NOT(ISBLANK([Value])))
    RETURN
    CONCATENATEX(FilteredDevices, [Value], ", ")

     
    In the case where data is not pivotted, create measure:

    DevicesNeeded2 = 
    CONCATENATEX(
        FILTER(
            IOH,
            IOH[Location] = SELECTEDVALUE(IOH[Location]) &&
            IOH[Val] = 0
        ),
        IOH[DeviceModelShort],
        ", "
    )