Forum Discussion
Incorrect result when using multiple similar measures with TREATAS and variables in the same visual.
When two measures that have a very similar looking but different calculation both use TREATAS with a variable as the first TREATAS parameter and are used in the same visual the output of one of the measures will incorrectly be a duplicate of the output of the other measure. This looks like an incorrectly applied DAX fusion optimization, which measure output gets duplicated seem to depend on which measure you add to the visual first.
This is what the output should look like:
Here is the incorrect output:
Here is the DAX code of the two measures:
Here is the data from the simple 2 table data model used to demonstrate the problem.
I can provide a PBIX file that demonstrates the problem if needed.
5 Replies
- ValtteriNCommunity Champion
Hi,
Is there a specific reason you want to use TREATAS here?
If you want to display running total and day values there are simpler methods. e.g. with the new visual calculations:Data:
Measure 27 is just SUM
- MichaelOgazAdvocate I
Hi ValtteriN
The example data and measures I posted in this Issue are not the real world situation where I have encountered this bug. This is a set of data and measures just used to demonstrate the problem in a simple and direct way.
- tamerj1Community Champion
Hi MichaelOgaz
The Date column in the table visual is coming from which table?- MichaelOgazAdvocate I
Hi tamerj1
The Column labeled Date in the table visual is 'Date'[Date].
- MichaelOgazAdvocate I
It is disappointing that this got moved into the DAX Help section when I created it as in Issue and I am trying to report a DAX engine optimization bug.