Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MichaelOgaz
Advocate I
Advocate I

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:

MichaelOgaz_4-1713805428552.png

 

Here is the incorrect output:

MichaelOgaz_0-1713805197478.png

 

Here is the DAX code of the two measures:

MichaelOgaz_1-1713805267817.png

 

 

MichaelOgaz_3-1713805309964.png


Here is the data from the simple 2 table data model used to demonstrate the problem.

MichaelOgaz_1-1713805967077.png

 

 

MichaelOgaz_0-1713805941341.png

 

 

MichaelOgaz_7-1713805613054.png


I can provide a PBIX file that demonstrates the problem if needed.

5 REPLIES 5
MichaelOgaz
Advocate I
Advocate 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.

tamerj1
Super User
Super User

Hi @MichaelOgaz 
The Date column in the table visual is coming from which table?

Hi @tamerj1

The Column labeled Date in the table visual is 'Date'[Date].

ValtteriN
Super User
Super User

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:

ValtteriN_0-1713865948264.png

ValtteriN_3-1713866070896.png

Measure 27 is just SUM





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors