Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Don't show Total Service and Desktop

Don't show total

 

This is a measure wiht IF another measure don't heave IF, problem happens on the desktop and the service

  

Total comprometido_old when I expot to Excel R$ 7.400,00

Measuers:

 

COMPROMETIDO_old = IF(CALCULATE([TOTALPEDIDO] - ([ENTRADACUSTO] + [ENTRADACONTABIL]);RELATEDTABLE(PEDIDO)) < 0 ; 0 ; CALCULATE([TOTALPEDIDO] - ([ENTRADACUSTO] + [ENTRADACONTABIL]);RELATEDTABLE(PEDIDO)))

 

ENTRADACUSTO = CALCULATE([valor_Custo]; CUSTO[FLAGCOMP] = TRUE())+0

 

ENTRADACONTABIL = CALCULATE([Valor_Contabil]; CONTABIL[FLAG] = TRUE())+0

 

TOTALPEDIDO = CALCULATE(SUM(PEDIDO[VALOR_PED]);PROJETOS[ENCERRADO] = 13; PEDIDO[ELIM_PED] <> "L"; PROJETOS[ORDEM] <> 0; ALL(MES[MÊS]); ALL(ANOS[ANO]))

 

Well, the problem is that it does not show the total, compromised_old is a measure of the monetary type, it generates a rest of the fields that I listed above.

 

Link To Download the PBIX

 

Please help me =D

 

Thanks

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Based on your data, you can try the measure below. The trick is the context. Please check out the demo in the attachment. 

PLEASE BE AWARE OF YOUR PRIVACY!

COMPROMETIDO_new =
VAR vCom =
    CALCULATE (
        [TOTALPEDIDO]
            - ( [ENTRADACUSTO] + [ENTRADACONTABIL] ),
        RELATEDTABLE ( PEDIDO )
    )
RETURN
    IF (
        HASONEVALUE ( ORDENS[ORDEM] ) && HASONEVALUE ( PEDIDO[NR_IT_PED] ),
        IF ( vCom < 0, 0, vCom ),
        SUMX (
            SUMMARIZE (
                PEDIDO,
                ORDENS[ORDEM],
                ORDENS[PROJETO],
                PEDIDO[NR_IT_PED],
                "v", CALCULATE (
                    [TOTALPEDIDO]
                        - ( [ENTRADACUSTO] + [ENTRADACONTABIL] ),
                    RELATEDTABLE ( PEDIDO )
                )
            ),
            IF ( [v] < 0, 0, [v] )
        )
    )

Don_t_show_Total_Service_and_Desktop

 

Best Regards,

Dale

Community Support Team _ Dale
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

1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Based on your data, you can try the measure below. The trick is the context. Please check out the demo in the attachment. 

PLEASE BE AWARE OF YOUR PRIVACY!

COMPROMETIDO_new =
VAR vCom =
    CALCULATE (
        [TOTALPEDIDO]
            - ( [ENTRADACUSTO] + [ENTRADACONTABIL] ),
        RELATEDTABLE ( PEDIDO )
    )
RETURN
    IF (
        HASONEVALUE ( ORDENS[ORDEM] ) && HASONEVALUE ( PEDIDO[NR_IT_PED] ),
        IF ( vCom < 0, 0, vCom ),
        SUMX (
            SUMMARIZE (
                PEDIDO,
                ORDENS[ORDEM],
                ORDENS[PROJETO],
                PEDIDO[NR_IT_PED],
                "v", CALCULATE (
                    [TOTALPEDIDO]
                        - ( [ENTRADACUSTO] + [ENTRADACONTABIL] ),
                    RELATEDTABLE ( PEDIDO )
                )
            ),
            IF ( [v] < 0, 0, [v] )
        )
    )

Don_t_show_Total_Service_and_Desktop

 

Best Regards,

Dale

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.