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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Fragan
Helper III
Helper III

Filter takes only in consideration some columns

Hey,

I have this table :

 

image.png

 

 

 

I have this Measure that does cumulative sum of Attribute1 :

 

 

 

Measure2 = 

SUMX (
    DISTINCT ( 'Table3'[attributes] );
    SWITCH (
        'Table3'[attributes];
        "Attribut3";CALCULATE ( SUM ( 'Data'[value] ); Filter(ALL('Data'); 'Data'[date] <= MAX( 'Data'[date]) && 'Data'[attributes] = "Attribut1") );
            var a = 'Table3'[attributes] return
        CALCULATE ( SUM ( 'Data'[value] );'Data'[attributes]=a)
    )
)

 

 

I want to create a histogram using this, and the problem is that using this measure it's impossible to apply a filter to the histogram. For example if i add "group" as the first axis of the histogram, i get the exact same value for Attribut3 for both groups.

 

Ifixed this by changing my mesure to :

 

Measure2 = 

SUMX (
    DISTINCT ( 'Table3'[attributes] );
    SWITCH (
        'Table3'[attributes];
        "Attribut3";CALCULATE ( SUM ( 'Data'[value] ); Filter(ALLEXCEPT('Data';Data[group]); 'Data'[date] <= MAX( 'Data'[date]) && 'Data'[attributes] = "Attribut1") );
            var a = 'Table3'[attributes] return
        CALCULATE ( SUM ( 'Data'[value] );'Data'[attributes]=a)
    )
)

 

But here im telling him manually to exclude Data[group] from filters. Is there anyway to tell him to take only Data[date] and Data[attributes] ?


Regards

 

1 ACCEPTED SOLUTION

OK, maybe KEEPFILTERS or REMOVEFILTERS, I can't make heads or tails of what you want. If the ALLEXCEPT works I don't understand why you need an alternative to it. And it sounds like you want it, but then you say you don't. ALLEXCEPT doesn't exclude group from the filter, technically, it maintains the filter for group but not for anything else.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

Not sure I am understanding this fully. In your second formula, you are starting with a filter context that includes the filter context for your group column, which it sounds like is what you want. Then you are filtering that down from there for data and attribute columns. Correct?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

In the first measure, the cumulative sum was working, but i noticed that i couldn't apply visual "Group" filter. So i added the ALLEXCEPT and the visual filter worked.

 

My question is : how to include only date and attributes in the filter ? 

OK, this is where I am getting confused. You say you want the visual filter for Group and then you say it works and is good but then you turn around and say you don't want it. If you don't want it, go back to the first formula?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

What im looking for is an Alternative for

ALLEXCEPT('Data';Data[group])

Instead of excluding Data[group] from the filter, i want to specify only the columns i want to include(which are Data[date] and Data[attributes]).

Hi @Fragan ,

 

Please try to replace

ALLEXCEPT('Data';Data[group])

with 

ALLEXCEPT('Data';'Data'[date];'Data'[attributes])

 

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

OK, maybe KEEPFILTERS or REMOVEFILTERS, I can't make heads or tails of what you want. If the ALLEXCEPT works I don't understand why you need an alternative to it. And it sounds like you want it, but then you say you don't. ALLEXCEPT doesn't exclude group from the filter, technically, it maintains the filter for group but not for anything else.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors