Forum Discussion

felipefrutuoso's avatar
felipefrutuoso
Frequent Visitor
5 years ago

TREATAS is not bringing the correct value

Hi.
 I have a model where one table is apart for my entire model, in this table is configured the filter for all measures. Due to this model, I'm using TREATAS to build all measures , one of this measures is bringing wrong values, looks like that the TREATAS is not consider all conditions. in My model, I have dim_x (apart dimension) from this dimension I go to dim_a , from dim_a I go to dim_b and finaly from dim_b I go to fact.

 

EVALUATE 
var x = 
CALCULATE (
    DISTINCTCOUNT ( 'FID fact'[value] ),
    TREATAS (
        VALUES ( 'dim x '[id] ),
        'dim_a'[id]
    ),
    TREATAS (
        VALUES ( 'dim_a'[id] ),
        'dim_b'[id]
    ),
    TREATAS (
        VALUES ( 'dim_b'[id] ),
        'fact'[id]
    )
)

return row("result",x)

 

 I don't know what's wrong with my code.  if someone knows any tip with treatas I'd appreciate .

cheers.

1 Reply

  • Is only dim_x disconnected?  are dim_a and dim_b connected to the fact table? (If so then the last two TREATAS are not necessary)