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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
timward10
Helper II
Helper II

Formula

Hi, 

 

I am trying to pull back the count of the account in another table, but also include a filter to select the date. 

 

Currently for the count, it is just bringing back a total instead of it being related to the 'name' column, this is before I have tried to add in the date name. The reference for the date name is year month in the event table.  

 

timward10_0-1747226872301.png

Can anyone help please? 

 

Thanks 

 

 

1 ACCEPTED SOLUTION

You could use

Jan'25 =
CALCULATE (
    COUNTROWS ( Event ),
    FILTER (
        Event,
        Event[Account Name] = Test[Name]
            && Event[Activity Date (Month Year)] = "Jan 2025"
    )
)

View solution in original post

3 REPLIES 3
timward10
Helper II
Helper II

Perfect, that has worked! 

 

How do I add another filter into the same query to only return anything with a January date? I have a column in the event table called Month Year so I can reference that. 

 

Using the below but it won't work with the second part of the filter. 

 

Jan'25 = CALCULATE(
    COUNTROWS(Event),
    FILTER(Event,Event[Account Name]
    =(Test[Name],
    Event,Event[Activity Date (Month Year)]
    ="Jan 2025")))

 

Thanks!

You could use

Jan'25 =
CALCULATE (
    COUNTROWS ( Event ),
    FILTER (
        Event,
        Event[Account Name] = Test[Name]
            && Event[Activity Date (Month Year)] = "Jan 2025"
    )
)
johnt75
Super User
Super User

As you're creating a calculated column you have a row context, not a filter context, and SELECTEDVALUE only works in a filter context. Just replace the SELECTEDVALUE with Test[Name] and it should work.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.