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

Simple DAX calculation wrong

Hi, I just started using Power BI so I am slowly navigating as I go. 

 

I am trying to recreate a report that I did in Excel but a simple calculation of (x-y)/x doesn't work in Power BI. A couple of them come out okay, mostly just NaNs. I know it works because it does in my Pivot table (pic 2). I tried both SUM and Average. Only average gave me a few correct answers.

 

Thank you in advance!

 

1.PNG2.PNG

1 ACCEPTED SOLUTION

Hi @melodypoh,

 

My former formula missed a parenthesis, sorry:

 

BAND= Divide( Sum(Data[Q List])-Sum(Data[Q Band]),Sum(Data[Q List}),blank()).

Try trhis Please

 

Ninter

View solution in original post

11 REPLIES 11
Interkoubess
Solution Sage
Solution Sage

Hi @melodypoh,

 

Did you try for example :

 

BAND= Divide( Sum(Data[Q List]-Sum(Data[Q Band]),Sum(Data[Q List}),blank()).

 

Let us know.

 

Ninter

It didn't... Please see the screenshot.

Hi @melodypoh,

 

What is the name of your table?

 

I wrote Data because I thought it was named Data, please replace Data by the real name.

 

Let us know...

 

Ninter

Sloppy typing. You're missing a close parentheses and you used a curly bracket instead of a square bracket.

 

BAND = DIVIDE(
	SUM(Data[Q List]) - SUM(Data[Q Band]),
	SUM(Data[Q List]),
	BLANK()
)




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

Proud to be a Super User!




Yeah I was typing too quickly.

 

Thank you @KHorseman.

 

@melodypoh please try the corrected one and let us know.

 

Ninter

Looks like they all produced the same answers. Wow, is this supposed to be this complicated? 

 

4.PNG

Hi,

 

Looks like there is some relationship missing.  Share the link from where i can download your workbook.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Are you adding this formula as a column? It should be a measure I think.





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

Proud to be a Super User!




Hi @melodypoh,

 

Yes as @KHorseman explained, it should be a measure, not a column.

Do you want it to be in column?

 

Ninter

@Interkoubessah yeah looks like you caught it at the same time I did. Cool.





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

Proud to be a Super User!




Hi @melodypoh,

 

My former formula missed a parenthesis, sorry:

 

BAND= Divide( Sum(Data[Q List])-Sum(Data[Q Band]),Sum(Data[Q List}),blank()).

Try trhis Please

 

Ninter

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.