Good day.
This is my first post to the forum.
After going through the Financial Statements course, I am building my own statement.
In this example I want a statement that helps me calculate and report on the produce sold.
I have:
A measure table
A sales data table
A report template
I would like to have line times that show how many of each type of fruit is sold and a total row that sums up all apples sold (green apples + red apples = total).
It could be that we start selling purple apples next year. In that case, I want to be able to add purple apples as product code 1.3. That would allow me not have to update my DAX for total apples since I want it to pull the total using something like the following.
@Melissa ,
Good day.
Thank you very much for your thoughtful and prompt response.
I have read through it a couple of times.
I think it will be a couple more times before I completely understand it.
You created the result I asked for so I am checking it as solved.
You are certainly an expert.
@Melissa ,
Good day again.
As I thought about the excellent solution you provided, is it possible to create DAX that would eliminate the need for a Type variable and instead use the Product Code as a filter in the Template? This would allow the creation of a structure/taxonomy in the Product Code.
For example:
= Grapes
1.1 = red grapes
1.2 = green grapes
1.1.1 = red grapes with seeds
1.1.2 = red grapes without seeds
1.2.1 = green grapes with seeds
1.2.2 = green grapes without seeds
The desired effect would be that I could use portions of the Product Code using LEFT() to derive my subtotals and totals in the template.
Using % as a representative wildcard,
If the SELECTEDVALUE is
1.% would apply to all grapes.
1.1% would apply to all red grapes (seeded and non seeded)
Was there something wrong in my original DAX that prevented this from happening?
If the is inappropriate forum follow up, please accept my apologies and disregard my questions.