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
Anonymous
Not applicable

Formula to display filtered aggregate value in a card

Hello - I have created the filtered  matrix visual below and would like to create a formula to display the total station count (41 in this case) in a card, similar to the Full Market Count card.  Your help is very much appreciated!

Matrix.PNG

7 REPLIES 7
Sean
Community Champion
Community Champion

@Anonymous

Okay it looks like the station count is a column already containing the count number

 

So all you need to do is create a MEASURE that sums it and place it in the Card

 

MEASURE = SUM ( Table[Station Count] )

 

Anonymous
Not applicable

So the 41 stations are filtered down from a total 150.  I am filtering on station count >=3.  The station count is a sum of the stations in each market, that I accomplished via a Matrix visual.  

 

Station count is a new measure that does a distinct count on the station names that are in the original table.  And I can't use this in the formula you suggest (PBI does not allow me to use a calculated field in the SUM expression.

Sean
Community Champion
Community Champion

Okay if its already a Measure why can't you place it in a Card and use either the visual level or page level filters?

Anonymous
Not applicable

I don't think you can filter an aggregate value in a card

Sean
Community Champion
Community Champion

Okay you have Market Names and Stations Names and the Station Count (Measure) = disctinct count of the Station Names

 

You basically want to get the Number of Stations in Markets with More than 3 Stations

 

On the Modeling Tab => click New Table and type this...

 

 

Summary Table =
SUMMARIZE (
    TableName,
    TableName[Nielsen Market Name],
    "Number of Stations", [Station Count]
)

 Then create this Measure

 

Stations in Markets with More than 3 =
CALCULATE (
    SUM ( 'Summary Table'[Number of Stations] ),
    FILTER ( ALL ( 'Summary Table' ), 'Summary Table'[Number of Stations] > 3 )
)

Then this Measure will should give you the answer! Smiley Happy

 

Anonymous
Not applicable

So I did not give you all of the information up front (I didn't think it was relative)

 

The station count by market is dynamic based on my slicer selections.  For example, I am filtering via slicer for client stations and then filtering for markets with more than 3 client stations.  

 

Your suggestion above provided me with a sum total of all stations, because all markets have more than 3 stations.  It's when I apply the various slicers that the number drops below 3.  

 

Thank you for your help on this!

@Anonymous

 

How about the result if update the second measure provided by Sean as below.

 

Stations in Markets with More than 3 =
CALCULATE (
    SUM ( 'Summary Table'[Number of Stations] ),
    FILTER (
        ALLSELECTED ( 'Summary Table' ),
        'Summary Table'[Number of Stations] > 3
    )
)

 

Best Regards,

Herbert

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.