Help filter report

I WOULD LIKE THE REPORT TO STAY VISIBLE IF THE REQUEST UNIDADE SOLICITANTE IS BLANK

AND([Data]>=ANY(SELECT(FILTRO_Empresa[Data_Inicial],true)),
[Data]<=ANY(SELECT(FILTRO_Empresa[Data_Final],true)),
[Empresa]=ANY(SELECT(FILTRO_Empresa[Empresa],true)),
[UnidadeSolicitante]=ANY(SELECT(FILTRO_Empresa[UnidadeSolicitante],true)))

IF IT IS BLANK SHOW ALL REQUESTS ACCORDING TO THE PERIOD SELECTED ABOVE

0 2 81
2 REPLIES 2

Note: please change this to a โ€œquestionโ€

Try this:

AND(
  IF(IsNotBlank(Any(FILTRO_Empresa[Data_Inicial])), 
    [Data] >= Any(FILTRO_Empresa[Data_Inicial]),
  true), 
  IF(IsNotBlank(Any(FILTRO_Empresa[Data_Final])), 
    [Data] <= Any(FILTRO_Empresa[Data_Final]),
  true), 
  IF(IsNotBlank(Any(FILTRO_Empresa[Empresa])), 
    [Empresa] = Any(FILTRO_Empresa[Empresa]),
  true), 
  IF(IsNotBlank(Any(FILTRO_Empresa[UnidadeSolicitante])), 
    [UnidadeSolicitante] = Any(FILTRO_Empresa[UnidadeSolicitante]),
  true)
)
  • The basic idea is this:

    • if there is a value, then use that value in some logic statement; otherwise,
    • true - which when used in an AND() statement, becomes the equivalent of โ€œskip this stepโ€
  • So each โ€œbranchโ€ only uses the logic if thereโ€™s a value for that logic to run on; otherwise they all result in NO filter

    • And if all filters are blank, then every record is shown
    • Otherwise, each filter is applied independently

(adjust as you see fit)

I would like to thank (MultiTech_Visions) , the formula worked.
Thank you!

Top Labels in this Space