Forum Discussion
Need Help with DAX!!
I am not getting the correct calculation out of DAX.
Right number should be 107,568
Dc Count = DISTINCTCOUNT(Query1[Dc_nbr])
Debsidrian the issue is that 2988 is shown based on the top 5 dc_nbr based on the sum of damage cases whereas when you are multiplying the measure there is no TOP 5 and that's why you are getting a different number.
Either you need to create a seperate measure as below for TOP 5 and then use that in the multiplication and then it will work:
Damage Cases average per Dc_nbr test = CALCULATE ( AVERAGEX ( KEEPFILTERS ( VALUES ( 'Query1'[Dc_nbr] ) ), CALCULATE ( SUM ( 'Query1'[Damage Cases] ) ) ), TOPN ( 5, ALLSELECTED ( Query1[Dc_nbr] ), CALCULATE ( SUM ( Query1[Damage Cases] ) ), DESC ) )
4 Replies
- parry2kSuper User
Debsidrian the issue is that 2988 is shown based on the top 5 dc_nbr based on the sum of damage cases whereas when you are multiplying the measure there is no TOP 5 and that's why you are getting a different number.
Either you need to create a seperate measure as below for TOP 5 and then use that in the multiplication and then it will work:
Damage Cases average per Dc_nbr test = CALCULATE ( AVERAGEX ( KEEPFILTERS ( VALUES ( 'Query1'[Dc_nbr] ) ), CALCULATE ( SUM ( 'Query1'[Damage Cases] ) ) ), TOPN ( 5, ALLSELECTED ( Query1[Dc_nbr] ), CALCULATE ( SUM ( Query1[Damage Cases] ) ), DESC ) )- DebsidrianFrequent Visitor
Thank you!! that worked!
- DebsidrianFrequent Visitor
- DebsidrianFrequent Visitor