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
joef
Helper I
Helper I

total in report not Adding all values in a table column

Hi All,

I have a column in my report that shows how many inspections are completed this year, by location.

I have a measure that counts the number of inspections completion for this year:

Completed_Inspections_This_Year =
CALCULATE(
    DISTINCTCOUNT('Asset_Inspections'[Last inspection Date]),
    FILTER(
        'Asset_Inspections',
        YEAR('Asset_Inspections'[Last inspection Date]) = YEAR(TODAY())
    ),
    ALLEXCEPT('Asset_Inspections', 'Asset_Inspections'[Loc])
)

 

I have the totals value on, and it counts 6 rows, but there are 7 in the table as in the below screenshot

joef_1-1740774692296.png

Does anyone know why it would count only 6?  There are clearly 7 in the table 🙂

 

TIA,

Joe

 

1 ACCEPTED SOLUTION
nilendraFabric
Super User
Super User

Hello @joef 

 

looks like `DISTINCTCOUNT()` with `ALLEXCEPT()`, is behaving differently in totals.

try this

 

Completed_Inspections_This_Year =
VAR CurrentYear = YEAR(TODAY())
RETURN
SUMX(
VALUES('Asset_Inspections'[Loc]),
VAR LocationCount = CALCULATE(
DISTINCTCOUNT('Asset_Inspections'[Last inspection Date]),
YEAR('Asset_Inspections'[Last inspection Date]) = CurrentYear
)
RETURN
LocationCount
)

 

 

View solution in original post

3 REPLIES 3
joef
Helper I
Helper I

Hi @nilendraFabric ,

Thank you,  removing the ALLEXCEPT and returning the loc did the trick!

 

Thanks again,

Joe

 

 

v-kpoloju-msft
Community Support
Community Support

Hi @joef,
Thanks for reaching out to the Microsoft fabric community forum.


I would also take a moment to personally thanks @nilendraFabric, for actively participating in the community forum and his inputs.

 

After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it. Therefore, please refer to the attached pbix file.

I hope this should resolve your issue, if you need any further assistance, feel free to reach out.


If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Best Regards.

nilendraFabric
Super User
Super User

Hello @joef 

 

looks like `DISTINCTCOUNT()` with `ALLEXCEPT()`, is behaving differently in totals.

try this

 

Completed_Inspections_This_Year =
VAR CurrentYear = YEAR(TODAY())
RETURN
SUMX(
VALUES('Asset_Inspections'[Loc]),
VAR LocationCount = CALCULATE(
DISTINCTCOUNT('Asset_Inspections'[Last inspection Date]),
YEAR('Asset_Inspections'[Last inspection Date]) = CurrentYear
)
RETURN
LocationCount
)

 

 

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.

Top Kudoed Authors