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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

sales date not appearing - context transition

Hi, 

 

I have a visualization that shows sales cancellations per month. 

cdesseaux_0-1628103415904.png

Measure used is the following:

Distratos por data distrato = calculate (distinctcount('setelm_bi reservas_historicos_situacoes'[idreserva]),
'setelm_bi reservas_historicos_situacoes'[para_nome]="Distrato")
 
Drilling down on july, I get the following table:
cdesseaux_1-1628103482485.png

Id and cancellation date (data distrato) are as expected, but sales date (data venda distrato) only shows the one date that's within july. Measure used is:

Data venda distrato = calculate(max('setelm_bi reservas_historicos_situacoes'[Data cadastro]),
all('CalendarTableAlt'[MesAno abr]),
'setelm_bi reservas_historicos_situacoes'[para_nome]="Venda finalizada")
 
I used ALL to clear the filter on the month that came from the visualization, but it seems to have no effect. I'd be very grateful if anyone could help out...

Regards, 
Christophe
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Could you please share some sample data(exclude sensitive data) and your expected result with calculation logic and special examples in order to provide you a suitable solution? As checked the formula of measure [Data venda distrato], it will only return only max [Data cadastro] even though you used ALL function in table 'CalendarTableAlt'[MesAno abr]... Do you want to get all dates which filter the conditions or something else? 

Please try to update the formula of measure [Data venda distrato] as below and check whether it can return the correct result.

Data venda distrato =
CALCULATE (
    MAX ( 'setelm_bi reservas_historicos_situacoes'[Data cadastro] ),
    FILTER (
        ALL ( 'setelm_bi reservas_historicos_situacoes' ),
        'setelm_bi reservas_historicos_situacoes'[idreserva]
            = SELECTEDVALUE ( 'setelm_bi reservas_historicos_situacoes'[idreserva] )
            && 'setelm_bi reservas_historicos_situacoes'[para_nome] = "Venda finalizada"
    )
)

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

That worked perfectly, thanks a lot!

Anonymous
Not applicable

Hi @Anonymous ,

Could you please share some sample data(exclude sensitive data) and your expected result with calculation logic and special examples in order to provide you a suitable solution? As checked the formula of measure [Data venda distrato], it will only return only max [Data cadastro] even though you used ALL function in table 'CalendarTableAlt'[MesAno abr]... Do you want to get all dates which filter the conditions or something else? 

Please try to update the formula of measure [Data venda distrato] as below and check whether it can return the correct result.

Data venda distrato =
CALCULATE (
    MAX ( 'setelm_bi reservas_historicos_situacoes'[Data cadastro] ),
    FILTER (
        ALL ( 'setelm_bi reservas_historicos_situacoes' ),
        'setelm_bi reservas_historicos_situacoes'[idreserva]
            = SELECTEDVALUE ( 'setelm_bi reservas_historicos_situacoes'[idreserva] )
            && 'setelm_bi reservas_historicos_situacoes'[para_nome] = "Venda finalizada"
    )
)

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.