## Appendix A: Answers to Practic Exercises

A dedicated forum to help people when working through the book "Learn to Write DAX"
Jen
Posts: 6
Joined: Tue Feb 16, 2016 8:23 am

### Appendix A: Answers to Practic Exercises

Assuming I am working off the correct version of the Access database (Matt sent me a link to the file in Dropbox), there are naming inconsistencies between the Access database and the answers, as well as inconsistencies within the book itself.

A. SUM()
#3. Answer refers to Total Sales Value. The exercise on pg 36 has you creating "Total Sales Amount"
#4. Answer refers to Total Sales Value. The exercise on pg 36 has you creating "Total Sales Amount"
#5. Answer refers to ...SUM(Sales[SalesTax]). My Access file has Sales[TaxAmt]
#6. Answer refers to ...[Total Sales Value] + [Total Sales Tax]. The exercise on pg 36 has you creating "[Total Sales Amount]" and "[Total Sales Tax Paid]"

I'm using a printed copy of the book.

Jen
Posts: 6
Joined: Tue Feb 16, 2016 8:23 am

### Re: Appendix A: Answers to Practic Exercises

On Pg 50...

For #21, we're told to use [Margin \$] and [Total Sales]. If you mean to use the full name of the measure, shouldn't they be [Total Margin \$] and [Total Sales Amount]? (The answer key (pg 176) does use the full names.)
Ditto, for #22, we're told to use [Margin \$] and [Cost Price], which are referred to in the answer key as [Total Margin \$] and [Total Cost Value].
For #23, in the answer key, given that we're encouraged to always reuse existing measures, shouldn't the formula be [Tax %] = DIVIDE([Total Sales Tax Paid], [Total Sales Amount]?
On Pg 58...

#24 refers to Quantity, when the solution refers to OrderQuantity
#25 refers to ExtendedSales column, when the solution refers to ExtendedAmount
On Pg 65...
#28, Given the answer on pg 177, it seems like the measure name should be something more along the lines of,
[Average Extended Amount per Order Line]

MattAllington
Posts: 926
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

### Re: Appendix A: Answers to Practic Exercises

Jen wrote:
A. SUM()
#3. Answer refers to Total Sales Value. The exercise on pg 36 has you creating "Total Sales Amount"
#4. Answer refers to Total Sales Value. The exercise on pg 36 has you creating "Total Sales Amount"
#5. Answer refers to ...SUM(Sales[SalesTax]). My Access file has Sales[TaxAmt]
#6. Answer refers to ...[Total Sales Value] + [Total Sales Tax]. The exercise on pg 36 has you creating "[Total Sales Amount]" and "[Total Sales Tax Paid]"

I'm using a printed copy of the book.

I have a printed book in front of me (Australian version) and I don't have errors 3/4/6. So now I am concerned and will need to investigate, but it seems the printed copy in the USA may have had a version conflict. It is also possible I sent you a slightly different version of the DB - I will have to check that #5. So firstly - sorry for the confusion. And hopefully with this confirmation that there seems to be an issue, you will we be clear in your mind that these things are equivalent and hence correct if the answer is correct.
Matt Allington is Self Service BI Consultant, Trainer and Author of the book "Supercharge Power BI".
https://exceleratorbi.com.au/power-bi-online-training/

MattAllington
Posts: 926
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

### Re: Appendix A: Answers to Practic Exercises

Jen wrote:On Pg 50...

For #21, we're told to use [Margin \$] and [Total Sales]. If you mean to use the full name of the measure, shouldn't they be [Total Margin \$] and [Total Sales Amount]? (The answer key (pg 176) does use the full names.)
Ditto, for #22, we're told to use [Margin \$] and [Cost Price], which are referred to in the answer key as [Total Margin \$] and [Total Cost Value].
For #23, in the answer key, given that we're encouraged to always reuse existing measures, shouldn't the formula be [Tax %] = DIVIDE([Total Sales Tax Paid], [Total Sales Amount]?
On Pg 58...

#24 refers to Quantity, when the solution refers to OrderQuantity
#25 refers to ExtendedSales column, when the solution refers to ExtendedAmount
On Pg 65...
#28, Given the answer on pg 177, it seems like the measure name should be something more along the lines of,
[Average Extended Amount per Order Line]

Yes this is actually an editing issue in the book which I hadn't noticed before. My copy editor had taken what I intended to be English words describing the concept of Margin % (Margin \$ divided by Total Sales) and highlighted them as if they were Calculated Fields. That was never my intention and I see the confusion. Sorry about that.
Matt Allington is Self Service BI Consultant, Trainer and Author of the book "Supercharge Power BI".
https://exceleratorbi.com.au/power-bi-online-training/

PaulInSydney
Posts: 7
Joined: Sat Dec 10, 2016 2:43 pm

### Re: Appendix A: Answers to Practic Exercises

Jen,

Thanks for posting this, I was also getting caught out on the different names in Appendix A. Especially the TaxAmt one.

Regards,
Paul.