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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
SimonAbs
Frequent Visitor

Calculate(Count (....), (Datesbetween(....)) returns nothing

Hey guys 🙂

 

I insert the following Measure in Power BI Desktop:

 

Latest_NPS = CALCULATE(COUNTA(NPS[nps_category]);DATESBETWEEN(NPS[ts];[LastestDate_NPS_Start];[LatestDate_NPS_End]))

 

It retunrs: Nothing

 

Returns_NothingReturns_Nothing

 

If I insert this measure:

 

Latest_NPS = CALCULATE(COUNTA(NPS[nps_category]);DATESBETWEEN(NPS[ts];[LastestDate_NPS_Start];[LastestDate_NPS_Start]))

 

It retunrs: 1

11

 

Why I am not able to COUNTA the NPS[nps_category] for a specific timeline?

 

Thanks in advance,

Simon 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SimonAbs,

 

You can try to use below formula to calculate records between specific date range:

Latest_NPS =
VAR currStart =
    MAX ( NPS[LastestDate_NPS_Start] )
VAR currEnd =
    MAX ( NPS[LatestDate_NPS_End] )
RETURN
    CALCULATE (
        COUNTA ( NPS[nps_category] );
        FILTER ( ALLSELECTED ( NPS ); NPS[ts] IN CALENDAR ( currStart; currEnd ) )
    )

Regards,
Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @SimonAbs,

 

You can try to use below formula to calculate records between specific date range:

Latest_NPS =
VAR currStart =
    MAX ( NPS[LastestDate_NPS_Start] )
VAR currEnd =
    MAX ( NPS[LatestDate_NPS_End] )
RETURN
    CALCULATE (
        COUNTA ( NPS[nps_category] );
        FILTER ( ALLSELECTED ( NPS ); NPS[ts] IN CALENDAR ( currStart; currEnd ) )
    )

Regards,
Xiaoxin Sheng

Hi @Anonymous,

 

Thanks for the fast reply.

It works perfect 🙂

 

Best regards,

Simon 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors