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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chaichatp
Helper III
Helper III

Multiply colummns and got wrong answer. Any suggestions?

Capture.jpg

1 ACCEPTED SOLUTION

Probably simpler to convert your 3 year to a measure since you are already getting what you expect for your Allct Score measure in you visualization.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

Can you share sample data and sample output and formulas. If possible please share a sample pbix file after removing sensitive information.Thanks.
Proud to be a Datanaut My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Here is Data sample and The SCORE Allct*3 Yr column got an issue now. 

 

Since i would like to be able to filter the date by using the silcer and want the measure to recalculate the % of total row all the time so the formula in measure is 

 

SCORE Allct = DIVIDE(SUM('TOP500-CORREL0_7_TEST'[SCORE]),CALCULATE(SUM('TOP500-CORREL0_7_TEST'[SCORE]),ALLSELECTED('TOP500-CORREL0_7_TEST'[Ticker])),0)

 

and this is formula for SCORE Allct*3 Yr

 

SCORE Allct*3Yr = ([SCORE Allct]*'TOP500-CORREL0_7_TEST'[3 Yr. Annl TTR])/100

 

 

TickerDateScore(RAW DATA)SCORE Allct (Measure)3 Yr Annl TTR(RAW DATA)ScoreAllct * 3 Yr
A2/20/2020817.39%33%5.74%

B

2/20/2020715.22%20%3.04%
C2/20/2020613.04%15%1.96%
D2/20/2020817.39%15%2.61%
E2/20/2020919.57%10%1.96%
F2/20/2020817.39%5%0.87%
Greg_Deckler
Super User
Super User

What is the formula for the measure in your column formula? I'm guessing it has something to do with row versus filter context.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I should say like this, it seems it didnt multiply with my SCORE Allct at all(Measure), you can compare both yellow columns, it just divided 3 Yr. Annl TTR by 100 and here is the formula for both columns. 

 
 
SCORE Allct = DIVIDE(SUM('TOP500-CORREL0_7_TEST'[SCORE]),CALCULATE(SUM('TOP500-CORREL0_7_TEST'[SCORE]),ALLSELECTED('TOP500-CORREL0_7_TEST'[Ticker])),0)
 
and the output column is
 
SCORE Allct*3Yr = ([SCORE Allct]*'TOP500-CORREL0_7_TEST'[3 Yr. Annl TTR])/100
 
Capture.PNG

But Score Allct is a measure, it is going to calculate differently in row context versus in your visual. Because your Score Allct 3 Year is a calculated column, I believe that is where your issue lies. So, you likely either need to switch Score Allct 3 Year to be a measure or change Score Allct to a column. One way or the other.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Which way is simpler?

Probably simpler to convert your 3 year to a measure since you are already getting what you expect for your Allct Score measure in you visualization.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Already solved. Great

 

I have more question for the same table for Total row since the number should not be the same as the one before I multiply with SCORE Allct, they should be much less than the 2 colmns before. Any thought on that?

Capture.PNG

Right, thay is the measure totals problem. Look in the Quick Measure gallery for my quick measure, Measure Totals, The Final Word.

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Will look into it. THanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.