Forum Discussion

Standish's avatar
Standish
Frequent Visitor
5 years ago
Solved

DAX Measure Referencing Other Measures

Hello,

 

I have a requirement to display the below in a card visual.

I am looking to display: the sum of Measure 1 where Measure 2 = 0

- Expected result would be 27. 

- Current result is 36. (Including Vendors where Measure 2 = 0)

 

In a table visual, I am able to add Measure 2 as a visual level filter where Measure 2 = 0 and I get the correct result of 27.

However, I cannot add Measure 2 as a visual level filter to a card visual.

 

I have tried the below but am still only returning 36.

Any help would be greatly appreciated.

 

 

SUMX(
    SUMMARIZE(
        'Tbl_Vendors','Tbl_Vendors'[VendorID],
        "_Measure2",[Measure2]
    ),[Measure1]
)
CALCULATE(
    DISTINCTCOUNT('Tbl_Vendors'[VendorID]) ,
    FILTER('Tbl_Vendors', [Measure2]<1) ,
    FILTER('Tbl_Vendors',[Measure1]=1)
)

 

 

Vendor IDMeasure 1Measure 2
11730910
15742410
14960110
11701811
19134511
14583510
10179911
15646610
10027411
11106310
10007610
19138410
15888310
16808311
16633710
16840411
12374710
11024410
15111611
12649810
18353511
12953110
15736510
13693710
13836011
17718810
15304910
17354410
13959310
11701710
16717710
14518310
18941710
10640410
10544010
11747210
17249100
13493000
11712401
17716900
16648100
18770701
12782500
11452201
19163300
16254201
13714201

 

 

  • Hi Standish 

    Measure = 
    SUMX(  
        DISTINCT('Tbl_Vendors'[VendorID]) ,
        IF([Measure2]=0,[Measure1], 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 Standish 

    Measure = 
    SUMX(  
        DISTINCT('Tbl_Vendors'[VendorID]) ,
        IF([Measure2]=0,[Measure1], 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