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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

ALLSELECTED() with blank

Hello, I managed to solve a problem using the ALLSELECTED() function, but now the array has a lot of blank lines, how can I remove it?

By the filters I can't, since if I filter a column it excludes the value of the others.

Fluxo =
CALCULATE(
    [Total Fluxo] + [Total Saldo Bancário],
    FILTER(
        ALLSELECTED('D-Pagar + Receber'),
        'D-Pagar + Receber'[Data] <= MAX('BA-Data'[Data_Base])
    )
)

 

DOUGLASBR5991_0-1665359284197.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Could you please try the below whether it suits your requirement?

Fluxo =
IF (
    [Total a receber measure] <> BLANK ()
        && [Tltal a pagar measure] <> BLANK (),
    CALCULATE (
        [Total Fluxo] + [Total Saldo Bancário],
        FILTER (
            ALLSELECTED ( 'D-Pagar + Receber' ),
            'D-Pagar + Receber'[Data] <= MAX ( 'BA-Data'[Data_Base] )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Could you please try the below whether it suits your requirement?

Fluxo =
IF (
    [Total a receber measure] <> BLANK ()
        && [Tltal a pagar measure] <> BLANK (),
    CALCULATE (
        [Total Fluxo] + [Total Saldo Bancário],
        FILTER (
            ALLSELECTED ( 'D-Pagar + Receber' ),
            'D-Pagar + Receber'[Data] <= MAX ( 'BA-Data'[Data_Base] )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thanks for your @Jihwan_Kim solution.

I just needed to change the "&&" operator to "||" and it worked perfectly.

Thanks a lot for the solution.

Fluxo =
IF (
    [Total a Pagar] <> BLANK ()
    || [Total a Receber] <> BLANK (),
CALCULATE(
        [Total Fluxo] + [Total Saldo Bancário],
                FILTER(
                ALLSELECTED('D-Pagar + Receber'),
                'D-Pagar + Receber'[Data] <= MAX('BA-Data'[Data_Base])
)
    )
)

 

DOUGLASBR5991_0-1665413427946.png

 

Anonymous
Not applicable

Hi, @Shaurya 

These blank values are traditional when I use ALLSELECTED(), the filter needs to be applied within the measure itself to work. I've tried to use all the filters, I only have the measure, but I'm not getting it.

Shaurya
Memorable Member
Memorable Member

Hi @Anonymous,

 

Why don't you try using the filters? Select all values first and just uncheck Blank.

 

Screenshot 2022-10-10 052615.jpg

 

Works for you? Mark this post as a solution if it does!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.