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
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
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.