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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. 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
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors