Forum Discussion
Aggregating using DAX
- 2 years ago
Create a date dimension table and establish a relationship to your date column. Make your reseller ID data type of text. Create two measures:
Total VAT = SUM( Vat Column )
Item Count = COUNT( Item Column ) or if you want unique item count, DISTINCTCOUNT
Then on your report canvas, drag the Year column from your date table, the Reseller ID column, and your two measures into the visual of your choice.
*There are some awesome Power BI 101 videos online which will give you the foundation you need. Good luck!
Thank you for your reply. So I assume you mean the measure approach is the right way to do it.
I have already came accross the sum and count functions but as asked above, how do you aggregate with these conditions:
1. the sum of all 'PO Total VAT Ex' for each ResellerID and each YEAR.
2. the count of items for each ResellerID and each YEAR.
Thank you
Adrian
Create a date dimension table and establish a relationship to your date column. Make your reseller ID data type of text. Create two measures:
Total VAT = SUM( Vat Column )
Item Count = COUNT( Item Column ) or if you want unique item count, DISTINCTCOUNT
Then on your report canvas, drag the Year column from your date table, the Reseller ID column, and your two measures into the visual of your choice.
*There are some awesome Power BI 101 videos online which will give you the foundation you need. Good luck!
- Adrian_Celis2 years agoRegular Visitor
Hi CoreyP
Thank you! It seems to work and simpler than I thought.I was overthinking that the formula should be something like Sum of PO Total VAT Ex filtered by current item's year and reseller ID. But you just have to drag them in the report canvas.
Thanks for the help.Regards,
Adrian