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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ddpl
Solution Sage
Solution Sage

Calculate Count...

Data...

 

Client IDDate
A101-Aug-22
A202-Aug-22
A203-Aug-22
A304-Aug-22
A305-Aug-22
A306-Aug-22
A407-Aug-22
A408-Aug-22
A409-Aug-22
A410-Aug-22
A511-Aug-22
A512-Aug-22
A513-Aug-22
A514-Aug-22
A515-Aug-22

 

I want a measure to count Client Id for Date>= 10th Aug, 2022 in table visual as shown below...

 

Client IDDateReqirement
A410-Aug-22---1
A511-Aug-22---5
A512-Aug-22---5
A513-Aug-22---5
A514-Aug-22---5
A515-Aug-22---5
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ddpl ,

 

I think you can try this code to create a measure.

Count =
IF (
    MAX ( 'Table'[Date] ) >= DATE ( 2022, 08, 10 ),
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Client ID] ),
            'Table'[Date] >= DATE ( 2022, 08, 10 )
        )
    )
)

Result is as below.

RicoZhou_0-1668157938355.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
MHTANK
Helper III
Helper III

You can go through Quick measure-> Total for category (filters applied)->

 

Base Value = Client ID and Category = Date

and drag in matrix

ddpl
Solution Sage
Solution Sage

@amitchandak ,

 

I'm expecting something like below...

 

Count = CALCULATECOUNTTable[Client ID]), FILTERTable, Table[Date]>=DATE(2022,8,10), ALLEXCEPT( Table, Table[Client ID] ) )
 
but it won't work.
Anonymous
Not applicable

Hi @ddpl ,

 

I think you can try this code to create a measure.

Count =
IF (
    MAX ( 'Table'[Date] ) >= DATE ( 2022, 08, 10 ),
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Client ID] ),
            'Table'[Date] >= DATE ( 2022, 08, 10 )
        )
    )
)

Result is as below.

RicoZhou_0-1668157938355.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@Anonymous ,

 

It worked as expected, Thanks for your sharp DAX.

amitchandak
Super User
Super User

@ddpl , Use an after date slicer, Create a date table and join that with your table and create measure like

 

calculate(countrows(Table), allselected(Date))

 

or with selected date as 10th

 

calculate(countrows(Table), filter(all(Date), date[Date] >= maxx(allselected(Date) , date[Date]) ) )

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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