Forum Discussion

setis's avatar
setis
Icon for Post Partisan rankPost Partisan
5 years ago
Solved

Calculated column. Bringing a TRUE/FALSE value.

Dear all, 

 

I need a calculated column that brings a value from another table. The data type from this other table (called "list")  is TRUE/FALSE and I'm getting the error that MAX cannot work with values of type Boolean. 

 

My CC is:

Accepted  = 
IF(ISBLANK(
CALCULATE(
    MAX('list'[Accepted]),
    FILTER('list', 
            'list'[CaseID] = All_KPIs_raw[ReferenceId]
            && 'list'[KPIName] = All_KPIs_raw[KPIName]))),
    "Not audited", 
CALCULATE(
    MAX('list'[Accepted]),
    FILTER('list', 
            'list'[CaseID] = All_KPIs_raw[ReferenceId]
            && 'list'[KPIName] = All_KPIs_raw[KPIName])))

 

How can I solve this?

  • Hi setis 

    Perhaps use DISTINCT( ) instead of MAX( )?

    Or otherwise

    SUMX('list', 'list'[Accepted] *1) > 0 

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

2 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi setis 

    Perhaps use DISTINCT( ) instead of MAX( )?

    Or otherwise

    SUMX('list', 'list'[Accepted] *1) > 0 

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

  • setis , try new column like

    Accepted =
    IF(ISBLANK(
    MAXX(FILTER('list',
    'list'[CaseID] = All_KPIs_raw[ReferenceId]
    && 'list'[KPIName] = All_KPIs_raw[KPIName]),'list'[Accepted]),
    ),
    "Not audited",
    CALCULATE(
    MAXX(FILTER('list',
    'list'[CaseID] = All_KPIs_raw[ReferenceId]
    && 'list'[KPIName] = All_KPIs_raw[KPIName]),'list'[Accepted]),
    ))

     

    or


    Accepted =
    if(IF(ISBLANK(
    MAXX(FILTER('list',
    'list'[CaseID] = All_KPIs_raw[ReferenceId]
    && 'list'[KPIName] = All_KPIs_raw[KPIName]), if('list'[Accepted],1,0)),
    ),
    "Not audited",
    CALCULATE(
    MAXX(FILTER('list',
    'list'[CaseID] = All_KPIs_raw[ReferenceId]
    && 'list'[KPIName] = All_KPIs_raw[KPIName]),if('list'[Accepted],1,0)),
    )) =1, true(), false())