Forum Discussion

RGummels's avatar
RGummels
Frequent Visitor
7 months ago
Solved

Dax formula does not show up values, only zero

Is_Tier2_Only = VAR T1 = "Tier 1" VAR T2 = "Tier 2"   VAR HasTier1 =     [UDFPSEInjuryIlln__c2c4472af62141fdaa858a3432b95be8] = T1 ||     [UDFPSEReleaseofM__6e022d1143054d3cb79b9993100cee1b] ...
  • rohit1991's avatar
    7 months ago

    Hii RGummels 

     

    Your measure returns 0 because you are comparing columns directly to text inside a measure, which has no row context. As a result, expressions like Column = "Tier 2" always evaluate to FALSE. To fix this, wrap each column in SELECTEDVALUE() (when one value is expected in the visual) or use CALCULATE with COUNTROWS() to evaluate the condition in filter context. Once the comparison is done in the correct context, the measure will return 1 where “Tier 2” exists instead of always returning zero.

  • alish_b's avatar
    7 months ago

    Hey RGummels ,


    Are you creating a calculated column based on other columns (or is it a measure based on other measures)? The confusion is because it seems you are creating a calc column but the referencing of other columns is more of a pattern we use for measures. If you are indeed creating a calculated column, it just seems that none of those columns have 'Tier 2'. Please make sure there is no whitespace in those columns or incosistent formatting, you could use TRIM, CLEAN and UPPER/LOWER to make sure this problem is not interfering.
    Also, the condition for Tier1 seems redundant as you have not used it later (I am assuming this is just a variable during the testing phase).

    Hope it helps! But if it does not, please drop a sample of your dataset (sanitized copy without sensitive data and representative of your problem/data diversity).