Forum Discussion
Totals wrong
Hello Anonymous
it seems like total on bar chart you is summing the values rather than calculating the total base on the dax code.
cz if you notice in the table , the total for 1/9 is correct ( = 3 ) , however in the bar chart, the total is 6 which is = 1 + 2 + 3 .
i can think of an alternative is to create a measure per each product : and create a dummy measure and a total purchases per day as below:
dummy =
CALCULATE(
DISTINCTCOUNT(f_Purchases_Aditional[IdPurchase]),
REMOVEFILTERS(d_Products[Product]
))/3Purchases total =
CALCULATE(
DISTINCTCOUNT(f_Purchases_Aditional[IdPurchase]),
REMOVEFILTERS(d_Products[Product]
))
then you add the 4 measures as above.
finally, go to format visual, choose dummy variable, and set the value --> field = purchases total measure
change background color and value color .
you will get the following :
NB: to remove the legend "dummy" , just change the name of the measure in the visual to " "
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
- Anonymous2 years agoNot applicable
Hey, Daniel. Thanks for your response.
In my real life file there are more than 30 different categories, hence it would not be the best scenario creating 30+ measures and using it as legend.
However, I appreciate your response and will try to do something in those lines.
Thanks, man.