Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
felipefrutuoso
Frequent Visitor

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 1
lbendlin
Super User
Super User

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)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.