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
Vilmar
Resolver I
Resolver I

Comparar Períodos Distintos

Olá

Preciso comparar periodos distintos no mesmo visual, porem não estou conseguindo.

PBIX aqui 

 

Sem título.png

Esta medida dá certo:

 

Vendas1 = 
CALCULATE (
    [Total],
    ALLSELECTED ( dcalendario1 ),
    DATESMTD ( dcalendario1[Date] ),
    USERELATIONSHIP ( dcalendario1[Date], fSboprodql[DataPedido] ),
    USERELATIONSHIP ( dcalendario1[Date], 'fSboprodcd'[DataPedido] ),
    dStatus[Status Agrupador] = "FATURADO"
        || dStatus[Status Agrupador] = "CARTEIRA",
    'fSboprodcd'[OperacaoFiscal] = "VENDA",
    fSboprodql[OperacaoFiscal] = "VENDA"
)

 

 

Esta medida não dá certo:

 

Vendas2 = 
CALCULATE (
    [Total],
    ALLSELECTED ( dCalendario1 ),
    DATESMTD ( dcalendario1[Date] ),
    USERELATIONSHIP ( dCalendario2[Date], fSboprodql[DataPedido] ),
    USERELATIONSHIP ( dCalendario2[Date], 'fSboprodcd'[DataPedido] ),
    dStatus[Status Agrupador] = "FATURADO"
        || dStatus[Status Agrupador] = "CARTEIRA",
    'fSboprodcd'[OperacaoFiscal] = "VENDA",
    fSboprodql[OperacaoFiscal] = "VENDA"
)

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User
v-xulin-mstf
Community Support
Community Support

Hi @Vilmar,

 

You are dragging and dropping the 'Dia' of the table 'dCalendario1' in the table visual. It is not part of the 'Vendas2' date filter and I have added a new 'Dia' column to table 'fSboprodcd'.

Here is the output:

vxulinmstf_0-1629879954233.png

Please try the attached demo.

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

View solution in original post

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @Vilmar,

 

You are dragging and dropping the 'Dia' of the table 'dCalendario1' in the table visual. It is not part of the 'Vendas2' date filter and I have added a new 'Dia' column to table 'fSboprodcd'.

Here is the output:

vxulinmstf_0-1629879954233.png

Please try the attached demo.

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

@v-xulin-mstf@amitchandak as dicas de vocês me ajudou a criar uma terceira tabela calendario, fazer o relacionamento entre as duas tabelas fatos e colocar ela no visual. Agora deu certo. Obrigado!!

 

Sem título.png

amitchandak
Super User
Super User

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.