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
Zyg_D
Continued Contributor
Continued Contributor

ALLEXCEPT, but not taking ALL data

I want something similar to ALLEXCEPT. This function takes all the table without any filter and pays attention to only one of them. Basically, I want to supply this function with the table, which is already filtered (not the table at its fullest). I unsuccessfully tried using VALUES and KEEPFILTERS. 

 

This was my data before I introduced additional filter:

data.JPG

I successfully showed the Percentage in the tooltip:

percentage_of_bar1.JPGThis formula was used:

 

Percentage = 
DISTINCTCOUNT ( Table1[ID] )
    / CALCULATE ( 
        DISTINCTCOUNT ( Table1[ID] ), 
        ALLEXCEPT ( Table1, Table1[Year] ) 
    )

 

 

Then another column was added so that data now looks like this:

data2.JPG

It was used as a filter:

filter.JPG

 

Now the results are wrong:

percentage_of_bar2.JPG

 There will be more filters, so I don't want to reference them all. Without referencing this new column, how can I make my results appear correct?

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

Hi @Zyg_D ,

 

We can use the following measure to meet your requirement.

 

Percentage = 
DISTINCTCOUNT ( 'Table'[ID] )
    / CALCULATE ( 
        DISTINCTCOUNT ( 'Table'[ID] ), 
        FILTER(ALLSELECTED ( 'Table'),'Table'[year]=MAX('Table'[year])) 
)

 

The result like this,

 

All 1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhenbw-msft
Community Support
Community Support

Hi @Zyg_D ,

 

We can use the following measure to meet your requirement.

 

Percentage = 
DISTINCTCOUNT ( 'Table'[ID] )
    / CALCULATE ( 
        DISTINCTCOUNT ( 'Table'[ID] ), 
        FILTER(ALLSELECTED ( 'Table'),'Table'[year]=MAX('Table'[year])) 
)

 

The result like this,

 

All 1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.