The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hey,
I have this table :
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
Solved! Go to 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.
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?
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 ?
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.