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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RoxyGCT
Regular Visitor

Productx Incorrect result using a measure

Hi there

 

I need to calculate a rolling return on a weighted average return (calculated in a measure). This is in theory 'working' but the results are a bit off, almost like the rounding isnt correct. 

 

I have applied the same formula to a column (Measure 3 below) and to the measure (with the same values - Measure 2). The productx of the the column is correct, the same formaula on the measure is not correct.

 

Measure 2 and 3 SHOULD be the same?

 

Measure 3 = CALCULATE(PRODUCTX(Performance1,Performance1[performance]),DATESINPERIOD(Performance1[dat],LASTDATE(Performance1[dat]),-(Allselected(NumberTable[Number],NumberTable[Number])),MONTH))
 
Measure 2 = CALCULATE(PRODUCTX(AllMeasures,[1 Perf W1]),DATESINPERIOD(Performance1[dat],LASTDATE(Performance1[dat]),-(Allselected(NumberTable[Number],NumberTable[Number])),MONTH))
 
MEASURE:
1 Perf W1 = (if(IF(ISFILTERED(Performance1[nam]),DISTINCTCOUNT(Performance1[nam]),IF(ISBLANK(SELECTEDVALUE(Performance1[nam])),0))= 1,SUM('Performance1'[Orig Performance]),0) * SUM('%F1W1'[Weight])+if(IF(ISFILTERED(Performance2[nam]),DISTINCTCOUNT(Performance2[nam]),IF(ISBLANK(SELECTEDVALUE(Performance2[nam])),0))= 1,SUM('Performance2'[Orig Performance]),0) * SUM('%F2W1'[Weight])+if(IF(ISFILTERED(Performance3[nam]),DISTINCTCOUNT(Performance3[nam]),IF(ISBLANK(SELECTEDVALUE(Performance3[nam])),0))= 1,SUM('Performance3'[Orig Performance]),0) * SUM('%F3W1'[Weight])+if(IF(ISFILTERED(Performance4[nam]),DISTINCTCOUNT(Performance4[nam]),IF(ISBLANK(SELECTEDVALUE(Performance4[nam])),0))= 1,SUM('Performance4'[Orig Performance]),0) * SUM('%F4W1'[Weight])+if(IF(ISFILTERED(Performance5[nam]),DISTINCTCOUNT(Performance5[nam]),IF(ISBLANK(SELECTEDVALUE(Performance5[nam])),0))= 1,SUM('Performance5'[Orig Performance]),0) * SUM('%F5W1'[Weight]))+1
 
COLUMN:
 
performance = Performance1[Orig Performance]+1
 
 
product issue.PNG

 

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Way too much going on there to understand what exactly is happening but the column and measure would not have to return the same results as the column has row context and no filter context while the measure has only filter context. So, going to depend on a whole array of possibilities. 

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler , I might have been looking at this for too long and over explained!

 

I have simplified this and included the pbix. In short, the productx of a measure isn't generating the correct result when compared to excel, it is extreamely close which is why I think this could be a rounding issue.

 

https://www.dropbox.com/s/dciqrcsiu4eyvcu/fund%20analysis%20Sample.pbix?dl=0

https://www.dropbox.com/s/k4qejr511it9xnh/data6.csv?dl=0

 

Data.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.