Forum Discussion
Filtering on a Card
My first screen shot did not post for some reason, please see below:
that doesn't look greyed out to me have you tried to drop it down?
you could however manage this with a dax calculation
Unique Territories with variance =
VAR varonly =
IF ( SUM ( table[variance] ) > 0, 1, 0 )
RETURN
CALCULATE (
DISTINCTCOUNT ( table[territory] ),
FILTER ( table, variances = 1 )
)
- GregMorgan5 years agoNew Member
Thanks. It is definitely greyed out (hard to see in the screen shot). For some reason, Power BI will not allow a filtering a value on a distinct count of another column. (I have seen other users comment onthis as well).
I tried your solution and set up a new measure as follows:
Unique Territories with variance =
VAR varonly =
IF ( SUM ( 'SalesbyTerritory'[Variance] ) > 0, 1, 0 )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'SalesbyTerritory'[Territory] ),
FILTER ( SalesbyTerritory, SalesbyTerritory[Variance] = 1 )
)
When I add this to my card, I just get '(Blank)'. I am sure I am doing something wrong, are you able to determine the issue based on the code above?
Thanks again!
- vanessafvg5 years agoCommunity Champion
very hard to figure it out without seeing your data, can you provide a sample?
- GregMorgan5 years agoNew Member
Below is a sample of the raw data. Basically, this is sales data for multiple periods over 2020 and 2021. I want to show on a card how many distinct territories had a positive variance for any given 'Month' and 'Region' based on the 'Variance' column.