cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## Display 0 for past months and blank for future months

I have data (id and date) in one table and I'm wanting to show line graph for last year and this year (Jan-Dec).  I am wanting to see the 0 rows but don't want to see the future months 0 rows.  I have Date table = EngDate and the following measures.  The measures bring back the correct count but display continues to show future months of 0.

Measures:

EngCnt =CALCULATE(DISTINCTCOUNT(Engagement[EngagementID]) +0)
EngCntLY = CALCULATE(DISTINCTCOUNT(Engagement[EngagementID]),SAMEPERIODLASTYEAR('EngDate'[Date]))+0

I've tried changing measure to filter on max (ELM date = 3/31/2020), but then March doesn't show the 0 it should.
EngCnt = CALCULATE(DISTINCTCOUNT(Engagement[EngagementID]),filter(EngDate,EngDate[Date]<=max(EngDate[ELM Date]) +0))
1 ACCEPTED SOLUTION
Helper II

Nevermind, just figured it out.

EngCnt =
CALCULATE(DISTINCTCOUNT(Engagement[EngagementID]),filter(EngDate,EngDate[Date]<=max(EngDate[ELM Date])+0))+0

EngCntELM =
if(max('EngDate'[Date]) <= max('EngDate'[ELM Date]),[EngCnt],BLANK())
Helper II

Nevermind, just figured it out.

EngCnt =
CALCULATE(DISTINCTCOUNT(Engagement[EngagementID]),filter(EngDate,EngDate[Date]<=max(EngDate[ELM Date])+0))+0

EngCntELM =
if(max('EngDate'[Date]) <= max('EngDate'[ELM Date]),[EngCnt],BLANK())

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors