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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AliceFGX
Frequent Visitor

How to Exclude a company from a visual when data is not available every month?

Hello,

I have a powerBI report where I show on the rows the company names and on columns the months, like below. Some companies like company B do not send me the overdues data every month :

 

                     JAN FEB MAR JUN JUL

Company A  10    15    30    20   22

Company B   5      8                    10

 

I have a slicer that allows to show any months since jan 2021, here I selected only JAN to JUL 2023.

I want to have another slicer that alows me to exclude the companies that did not send data on the period shown on the table, and show only the company A and the others but not B.   So if I select only JAN 2023 and FEB 2023, company B should appear as well as A, as I have received the data for these months in 2023.

 

How can I do this? Thanks in advance to this great community!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AliceFGX ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Flag = 
VAR _company =
    SELECTEDVALUE ( 'Table'[Company] )
VAR _count =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Month] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Company] = _company )
    )
VAR _tab =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        'Table'[Company],
        'Table'[Month],
        "@count",
            CALCULATE (
                DISTINCTCOUNT ( 'Table'[Month] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[Company] = EARLIER ( 'Table'[Company] )
                )
            )
    )
RETURN
    IF ( _count < MAXX ( _tab, [@count] ), 0, 1 )

vyiruanmsft_0-1691045497957.png

Best Regards

View solution in original post

2 REPLIES 2
AliceFGX
Frequent Visitor

Thank you!

Anonymous
Not applicable

Hi @AliceFGX ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Flag = 
VAR _company =
    SELECTEDVALUE ( 'Table'[Company] )
VAR _count =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Month] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Company] = _company )
    )
VAR _tab =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        'Table'[Company],
        'Table'[Month],
        "@count",
            CALCULATE (
                DISTINCTCOUNT ( 'Table'[Month] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[Company] = EARLIER ( 'Table'[Company] )
                )
            )
    )
RETURN
    IF ( _count < MAXX ( _tab, [@count] ), 0, 1 )

vyiruanmsft_0-1691045497957.png

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.