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
yforti
Helper II
Helper II

Total of measure is wrong.

Hi guys!

 

I have a problem when i use my calculated measures in a table. I created the following measures:

 

Recebido =  CALCULATE([VL Rec Total];FILTER(OPMEXCONTA;OPMEXCONTA[OPME_x_NF_Itaim_01_07_19_a_3_20.Custo]<>BLANK())

 

Custo = CALCULATE(SUMX(OPMEXCONTA;OPMEXCONTA[OPME_x_NF_Itaim_01_07_19_a_3_20.Custo]))

 

Lucro custo total = CALCULATE([teste 1]-[Custo])
 
margem custo total = DIVIDE([Lucro custo total];[teste 1];0)
 
Here's the problem:
When i use the measure "margem custo total" (trying to calculate the profit margin) the total is calculated incorrecly for the first level categories (for exemple: Golden Cross-> Blue Circle), but for the second level categories the calculetion is correct (yellow).

 

Capturar.JPG

 

Can anyone helpe me?

4 REPLIES 4
parry2k
Super User
Super User

@yforti what is [VL Rec Total] measure 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

 

  1. VL Rec Total = CALCULATE([VL Rec OPME]+[VL Rec Pacote]+[VL Rec Simultâneo Total])
    1. VL Rec OPME = CALCULATE(SUMX(OPMEXCONTA;OPMEXCONTA[VLRECEBIDOOPME]))
    2. VL Rec Pacote = CALCULATE([VLFINALCALCULADO] - [GlosaPacote];FILTER(OPMEXCONTA;OPMEXCONTA[VLRECEBIDOPACOTE]<>BLANK()))
      1. VLFINALCALCULADO = CALCULATE(SUMX(OPMEXCONTA;OPMEXCONTA[VLFINAL]))
      2. Glosa Pacote = CALCULATE(SUMX(OPMEXCONTA;OPMEXCONTA[GLOSA PACOTE TRATADA]))
         
    3. VL Rec Simultâneio Total = CALCULATE([Vl rec simultâneo]+[Vl rec simultâeneo2])
      1. Vl rec simultâneo = CALCULATE([VLFINALCALCULADO];OPMEXCONTA[Status conta] = "Recebido Simultâneo")
      2. Vl rec simultâneo 2 = CALCULATE(SUMX(OPMEXCONTA;[Qtd Rec Simultâneo]*[VLunitposmax]);FILTER(OPMEXCONTA;OPMEXCONTA[Status Item]="Recebido Simultâneo");FILTER(OPMEXCONTA;[Glosa Externa] = BLANK()))

@yforti there is a lot more going on, are you open to share pbix file with sample data, remove sensitive information before sharing. You can share using one drive/google drive.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.