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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BBertels
Frequent Visitor

running total in combination with DistinctCount

Dear,

 

I have a table which is linked to a TimeTable. The table holds column 'Year' and 'name_active'. What I want to achieve is to list the number of distinct 'name_active' per year, but the number must be cumulative. I thought I have found it, but for year 1977, it goes wrong :

 

running_total.png

 

These are the measures I used:

  • Total name_active = IF(CALCULATE(DISTINCTCOUNT(full_table_detailed[name_active]))=0;0;CALCULATE(DISTINCTCOUNT(full_table_detailed[name_active])))
  • Using Quick Measure:
    Total name_active running total in YEAR =
    CALCULATE(
     [Total name_active];
     FILTER(
      ALLSELECTED('TimeTable'[YEAR]);
      ISONORAFTER('TimeTable'[YEAR]; MAX('TimeTable'[YEAR]); DESC)
     )
    )

I have also tried following measure, but no correct result:

 

Total name_active running total in YEAR =
CALCULATE(
 [Total name_active];
 FILTER(
  ALL('TimeTable'[YEAR]);
  'TimeTable'[YEAR]<= MAX('TimeTable'[YEAR]))
 )

 

Can someone please help?

Thank you in advance.

Kind regards,

Bart

 

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

See if my Time Intelligence The Hard Way Quick Measure helps at all: 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 

If not, post your data in a format that can be copied and pasted. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.