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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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 SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.