Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
I want to count the # of times a text value is in a column, but when I filter those text values, that total count does not change. I have mutliple related columns and when I filter down the line it decreases the count of some of the first items.
Solved! Go to Solution.
Hi @MulberyPie ,
I updated your sample pbix file(see the attachment), please check whether that is what you want. Please update the formula of measure [unfiltered_count] as below:
unfiltered_count =
VAR _species =
CALCULATETABLE (
VALUES ( 'plant_table'[Species] ),
FILTER (
'plant_table',
'plant_table'[Type] IN ALLSELECTED ( 'plant_table'[Type] )
)
)
RETURN
CALCULATE (
COUNT ( plant_table[Species] ),
FILTER ( ALL ( 'plant_table' ), 'plant_table'[Species] IN _species )
)
Best Regards
calculate(Count(Table[Column]), all(Table) )
or
calculate(Count(Table[Column]), all() )
The current equation returns the total entries in the column rather than the # of times each values is repeated. I have three values, 'text1', 'text2', 'text3' and they all return the same total number. How could I each values # of occurences?
Hi @MulberyPie ,
I'm not clear about your requirement, could you please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
So this is the data normally
When I filter I want the count column to have the same numbers as if it were unfiltered, but the rows shown be filtered. This is the output I want.
This is the output I normally get
Hi @MulberyPie ,
I updated your sample pbix file(see the attachment), please check whether that is what you want. Please update the formula of measure [unfiltered_count] as below:
unfiltered_count =
VAR _species =
CALCULATETABLE (
VALUES ( 'plant_table'[Species] ),
FILTER (
'plant_table',
'plant_table'[Type] IN ALLSELECTED ( 'plant_table'[Type] )
)
)
RETURN
CALCULATE (
COUNT ( plant_table[Species] ),
FILTER ( ALL ( 'plant_table' ), 'plant_table'[Species] IN _species )
)
Best Regards
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!