Forum Discussion
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 ID | Measure 1 | Measure 2 |
| 117309 | 1 | 0 |
| 157424 | 1 | 0 |
| 149601 | 1 | 0 |
| 117018 | 1 | 1 |
| 191345 | 1 | 1 |
| 145835 | 1 | 0 |
| 101799 | 1 | 1 |
| 156466 | 1 | 0 |
| 100274 | 1 | 1 |
| 111063 | 1 | 0 |
| 100076 | 1 | 0 |
| 191384 | 1 | 0 |
| 158883 | 1 | 0 |
| 168083 | 1 | 1 |
| 166337 | 1 | 0 |
| 168404 | 1 | 1 |
| 123747 | 1 | 0 |
| 110244 | 1 | 0 |
| 151116 | 1 | 1 |
| 126498 | 1 | 0 |
| 183535 | 1 | 1 |
| 129531 | 1 | 0 |
| 157365 | 1 | 0 |
| 136937 | 1 | 0 |
| 138360 | 1 | 1 |
| 177188 | 1 | 0 |
| 153049 | 1 | 0 |
| 173544 | 1 | 0 |
| 139593 | 1 | 0 |
| 117017 | 1 | 0 |
| 167177 | 1 | 0 |
| 145183 | 1 | 0 |
| 189417 | 1 | 0 |
| 106404 | 1 | 0 |
| 105440 | 1 | 0 |
| 117472 | 1 | 0 |
| 172491 | 0 | 0 |
| 134930 | 0 | 0 |
| 117124 | 0 | 1 |
| 177169 | 0 | 0 |
| 166481 | 0 | 0 |
| 187707 | 0 | 1 |
| 127825 | 0 | 0 |
| 114522 | 0 | 1 |
| 191633 | 0 | 0 |
| 162542 | 0 | 1 |
| 137142 | 0 | 1 |
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
Community 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