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! Request now

Reply
azul02
Frequent Visitor

Running Total measure using related column as category

I have the following measure to calculate a running total (count) across Creation Date.

 
Running Count of Documents = 
CALCULATE(
    COUNTA('Documents'[Document Id]),
    FILTER(
        ALLSELECTED(Documents),
        Documents[Creation Date] <= MAX(Documents[Creation Date])
    )
)

I then want to use this measure against a category from a related table called Person, that has a one-to-many relationship with Documents, but its giving odd results. The category is Person[Region (Latest Assignment)]. If I do a simple count on DocumentId I get this:

azul02_1-1667320238027.png

But the measure is producing this:

azul02_2-1667320279929.png

I'm missing something incredibly simple, I know, just in need of a nudge!


Edit: (sample tables)

Document Table

Document IdEmployee NumberCreation Date
38589231008230/06/2020
39668231008231/03/2021
38596241008530/06/2020
39676041008531/03/2021
39602641009330/03/2021
38585321009430/06/2020
39583651009429/03/2021
39704961011631/03/2021
40246511011620/07/2021

Person Table

Employee NumberRegion (Latest Assignment)
10082East Asia Region
10085East Asia Region
10093Australasia Region
10094East Asia Region
10116UKIMEA Region
3 ACCEPTED SOLUTIONS
aj1973
Community Champion
Community Champion

Hi @azul02 

To your measure add a VAR _Region = SELECTEDVALUE(TABLE(Region**)) then add it to the filter table of CALCULATE.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

azul02
Frequent Visitor

Thanks Amine, but apologies as I'm struggling to see how to include the variable to filter as it doesn't allow me to compare against column from the Person table, given the context of the filter is the Document table.

View solution in original post

aj1973
Community Champion
Community Champion

Hi @azul02 

Is this correct to you?

aj1973_0-1667566952772.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

7 REPLIES 7
mangaus1111
Solution Sage
Solution Sage

Hi @,

can you please send sample data of your 2 tables?

Update, thanks @mangaus1111 

HI @azul02 ,

is your expected result like this?

mangaus1111_0-1667562387740.png

 

Hi @azul02 ,

is your expected result like this?

Region (Latest Assignment)CountRT
Australasia Region11
UKIMEA Region23
East Asia Region69
aj1973
Community Champion
Community Champion

Hi @azul02 

To your measure add a VAR _Region = SELECTEDVALUE(TABLE(Region**)) then add it to the filter table of CALCULATE.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

azul02
Frequent Visitor

Thanks Amine, but apologies as I'm struggling to see how to include the variable to filter as it doesn't allow me to compare against column from the Person table, given the context of the filter is the Document table.

aj1973
Community Champion
Community Champion

Hi @azul02 

Is this correct to you?

aj1973_0-1667566952772.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors