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
Anonymous
Not applicable

Incorrect total in measure with division

Hello,

I have a table,

pbi1.png

 

and the % Meta column is totaling incorrect. The correct thing would be

 

pbi2.png

The measure is defined below

 

pbi3_2.png

pbi4_2.png

 

I need the total to be correct whith the totals as well. Line by line is already correct.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested to use HASONEVALUE.

You may try to create a measure to replace the TOTAL value.

%Meta=

IF(HASONEVALUE('Dados'[Classificacao]),[% Valores de Meta],[Resultado column sum divided by Meta column sum])

2.png

The HASONEVALUE is to perform a calculation in the row of the matrix to get the result1, and perform another calculation in the Total row to get the result2.

 

I can’t understand the language in your picture. If there is an error, please understand.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Syndicate_Admin
Administrator
Administrator
11 REPLIES 11
Syndicate_Admin
Administrator
Administrator

v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested to use HASONEVALUE.

You may try to create a measure to replace the TOTAL value.

%Meta=

IF(HASONEVALUE('Dados'[Classificacao]),[% Valores de Meta],[Resultado column sum divided by Meta column sum])

2.png

The HASONEVALUE is to perform a calculation in the row of the matrix to get the result1, and perform another calculation in the Total row to get the result2.

 

I can’t understand the language in your picture. If there is an error, please understand.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

For the Meta column, here are the details.

 

pbi01.png

 

The Resultado column has the natural data of the base.

pbi03.png

 

I need to divide the result column by Meta, with that Meta I only need one record, because they are all repeated.

 

There are no more measures involved.

littlemojopuppy
Community Champion
Community Champion

Can you provide the DAX for all the measures you're using?  Maybe a little sample data to cut and paste as well?

Anonymous
Not applicable

Hi @amitchandak,,

 

Below is the result.

 

pbi9.png

pbi10.png

amitchandak
Super User
Super User

@Anonymous , Try AverageX in place of SUMX and check

Anonymous
Not applicable

The field for MIN is the same on all lines.

Below is the result.

 

pbi7.png

pbi8.png

littlemojopuppy
Community Champion
Community Champion

It's calculating the MIN value across the entire table and using that as the denominator.

 

Instead try SUMX( TableName, MIN([FieldName]))

Anonymous
Not applicable

Thanks for the reply. When I do this it happens

 

pbi5.png

 

pbi6.png

littlemojopuppy
Community Champion
Community Champion

It's aggregating the percentages because you used SUMX in defining it.  Your measure should simply be DIVIDE([Numerator], [Denominator], BLANK() )

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.