cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SimonAbs Frequent Visitor
Frequent Visitor

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

Hey guys Smiley Happy

 

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_Nothing.pngReturns_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

1.png1

 

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

 

Thanks in advance,

Simon 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

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

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

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

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

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

SimonAbs Frequent Visitor
Frequent Visitor

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

Hi @v-shex-msft,

 

Thanks for the fast reply.

It works perfect Smiley Happy

 

Best regards,

Simon 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 406 members 3,534 guests
Please welcome our newest community members: