Forum Discussion
DataGeek16
8 years agoFrequent Visitor
DAX Subquery For Stacked Bar Chart
Need help in converting the following code to DAX to use in a stackedbarchart visual value. Select Sum(A) FROM ( Select SUM(EventCount) as A, DNSName FROM Testtable GROUP BY ...
- 8 years agoSorry, below correct formula
Measure = IF( CALCULATE ([Distinct Users], ALL( Testtable[DNSName] ) ) > 20 , SUM ( Testtable[EventCount] ) )
popov
8 years agoResolver III
Try this approach
Measure = IF( CALCULATE ([Distinct Users], ALL( Testtable[DNSName] ) > 20 ), SUM ( Testtable[EventCount] ) )
DataGeek16
8 years agoFrequent Visitor
I get this error when I try to build the measure.
Please note that [Distinct Users] is a calculated field/measure.
Error:
"The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column."
- popov8 years agoResolver IIISorry, below correct formula
Measure = IF( CALCULATE ([Distinct Users], ALL( Testtable[DNSName] ) ) > 20 , SUM ( Testtable[EventCount] ) )- popov8 years agoResolver IIIDistinct Users is measure as you described
- DataGeek168 years agoFrequent Visitor
That's awesome! This works well for my first scenario. I will test it with the other two scenarios and let you know if I have any further issues.
popov- Just to enhance my understanding, what is this measure doing differently that wasn't possible with the direct filtering? Please explain and thanks a bunch.