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
icturion
Resolver II
Resolver II

Count records with status T before today

Hi,

 

I'm trying to make a measure that counts the times a value is present before today.

 

This is what i got so far:

MO_T_STATUS_BeforeToday = Calculate(Countrows(AQZ_SAMP_VIEW);AQZ_SAMP_VIEW[MO_Status]="T")<TODAY()

 

The problem is that the measure returns "true" instead of the times the status has occurred.

 

Icturion

1 ACCEPTED SOLUTION
ChandeepChhabra
Impactful Individual
Impactful Individual

Try writing something like this

MO_T_STATUS_BeforeToday =
CALCULATE (
    COUNTROWS ( AQZ_SAMP_VIEW ),
    FILTER (
        AQZ_SAMP_VIEW,
        AQZ_SAMP_VIEW[MO_Status] = "T"
            && AQZ_SAMP_VIEW[Date Column] < TODAY ()
    )
)

Note that I have referenced a dummy date column which I am expecting that you'll have in your data

Thanks

View solution in original post

1 REPLY 1
ChandeepChhabra
Impactful Individual
Impactful Individual

Try writing something like this

MO_T_STATUS_BeforeToday =
CALCULATE (
    COUNTROWS ( AQZ_SAMP_VIEW ),
    FILTER (
        AQZ_SAMP_VIEW,
        AQZ_SAMP_VIEW[MO_Status] = "T"
            && AQZ_SAMP_VIEW[Date Column] < TODAY ()
    )
)

Note that I have referenced a dummy date column which I am expecting that you'll have in your data

Thanks

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.