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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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