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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Measure doesn't return total

Hi Everyone!

I have this measure, in which it looks for every previous value, e if it's equal to the actual value, it returns 1, otherwise 0. Nevertheless, it returns values by date, but doesn't return total in any visual. What could it be?

Count.Congelamento =
VAR EarlierEntryOfNomeDeOrigem =
    CALCULATE(
        MAX(fminuto[Timestamp]),
        FILTER(
            ALL(fminuto),
            fminuto[Nome da Origem]=SELECTEDVALUE(fminuto[Nome da Origem])
            && fminuto[Timestamp]<MAX(fminuto[Timestamp])
        )
    )

VAR EarlierEntryOfVazao = CALCULATE(
    SELECTEDVALUE(fminuto[Vazão],"no value"),
    FILTER(
        ALL(fminuto),
        fminuto[Nome da Origem]=SELECTEDVALUE(fminuto[Nome da Origem])
        && fminuto[Timestamp] = EarlierEntryOfNomeDeOrigem
    )
)

VAR Congela = IF(EarlierEntryOfVazao=SELECTEDVALUE(fminuto[Vazão],"no value"), 1, 0)

VAR Tabela = ADDCOLUMNS(SUMMARIZE(fminuto, fminuto[Nome da Origem], fminuto[Timestamp]), "Freeze", Congela)

RETURN
COUNTROWS(FILTER(Tabela, Congela=1))
GuiCarvalho_1-1667919174413.png

 


 



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

Hi @Anonymous ,

Please check the first two variables (EarlierEntryOfNomeDeOrigem, EarlierEntryOfVazao), which I suspect return blank values when you use this measure alone.

SELECTEDVALUE function

 

If they both return null values, try adding the complete filtering context to the measure in the visual. Please try like:

Measure = SUMX(VALUES('Table'[Data]),[Count.Congelamento])

 

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

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

Please check the first two variables (EarlierEntryOfNomeDeOrigem, EarlierEntryOfVazao), which I suspect return blank values when you use this measure alone.

SELECTEDVALUE function

 

If they both return null values, try adding the complete filtering context to the measure in the visual. Please try like:

Measure = SUMX(VALUES('Table'[Data]),[Count.Congelamento])

 

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

Anonymous
Not applicable

@v-cgao-msft Thank you very much!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.