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
Scarthart
Helper I
Helper I

How to make the calculation of a conditional division of the summed total

Good afternoon, What I want to do is that the measure prints the total which it is not doing, due to the condition.

Captura de pantalla (190).png


I just want the measurement to give me the total correctly.

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Scarthart ,

 

This is because the total does not have the filters from the row. If you want to get the totals right, you can complete the filters from the entity fields in your code.
like:

 

Mesesque alcanza SoldosINV =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        'Table'[Column2],
        'Table'[Column3],
        // Here please complete all the fields(filter) in the table visual.
        "Total",
            VAR Numerador = ...
            VAR Denomiador = ...
            RETURN
                DIVIDE ( Numerador, Denomiador, "..." )
    ),
    [Total]
)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
v-cgao-msft
Community Support
Community Support

Hi @Scarthart ,

 

This is because the total does not have the filters from the row. If you want to get the totals right, you can complete the filters from the entity fields in your code.
like:

 

Mesesque alcanza SoldosINV =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        'Table'[Column2],
        'Table'[Column3],
        // Here please complete all the fields(filter) in the table visual.
        "Total",
            VAR Numerador = ...
            VAR Denomiador = ...
            RETURN
                DIVIDE ( Numerador, Denomiador, "..." )
    ),
    [Total]
)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Padycosmos
Solution Sage
Solution Sage

Could you please explain the calculation in the  VAR Denominator ?

@Padycosmos , yes

 

Measure

This is the measure I use in the denominator

 

total de materia prima x referencia según la rotacion del producto 2 = IF(ISBLANK([total de materia prima x referencia según la rotacion del producto]),"0",[total de materia prima x referencia según la rotacion del producto])
 
Captura de pantalla (191).png

The total in this case not the total of that column. The result 13.31 is correct . It is (3465.364/260.426). Hope this explains the result.

 

Padycosmos_0-1673388136599.png

 

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.