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
sanrajbhar
Frequent Visitor

Measure Not returning correct Multiplication value

Hi,

 

I have Unpivot table which generated from one big table in power query mode. I need to do multiplication using  from one column  value to selected filter value row wise if Attribute is equal to "N60". but it showing wrong value? e.g

calcDax = SUMX(Table1,IF(Table1[Attribute]="N60",Table1[Value]*SELECTEDVALUE(Factor[N95f_val]),Table1[Value]))

sanrajbhar_0-1605251516684.png

Thanks, S

3 REPLIES 3
mahoneypat
Employee
Employee

Do your values have replicate rows (in this case the result is 5X of the expected)?  If so, use VALUES to get a single value.

 

calcDax = SUMX(VALUES(Table1[Value]),CALCULATE(IF(Table1[Attribute]="N60",Table1[Value]*SELECTEDVALUE(Factor[N95f_val]),Table1[Value])))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


thank you very much ..! I tried on small piece of data , it seems to work good. 

I was getting single value for column error  in your above dax. I changed the code with SUM. But now problem is - This CalcDax is going to be X-axis value in Scatter Plot. Now it is showing sum which looks not correct.

Any Solution ?

e.g

 

calcDax = SUMX(VALUES(Table1[Value]),CALCULATE(IF(sum(Table1[Attribute])="N60",max(Table1[Value])*SELECTEDVALUE(Factor[N95f_val]),max(Table1[Value]))))

 

Capture.PNG

Hi @sanrajbhar ,

 

Try the measure as below:

 

calcDax = IF(Table1[Attribute]="N60",Table1[Value]*SELECTEDVALUE(Factor[N95f_val]),Table1[Value])

 

If it doesnt work,would you pls upload your .pbix file to one drive business and share the link with us?

Remember to remove the confidential information.

 

Best Regards,
Kelly

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

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.