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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
brian0782
Helper II
Helper II

DAX measure producing duplicates

Hi

 

I've written the below DAX and included ALL to ignore any page level filters

 

Total Cases = CALCULATE(COUNTX('Case Record','Case Record'[Case ID]), FILTER(ALL('Case Record'),'Case Record'[Case Type ID]=1))
 
However when I drop the measure into a visual I'm getting repeating values. I'm confident my relationships have been configured properly. 
 
Any ideas why it's not working properly? Any help much appreciated.

 

brian0782_0-1631801813755.png

 

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @brian0782 ,

 

is the column "Week" also from the table 'Case Record'?

If yes, with the ALL you also remove the filter of Week, so every time you get the total.

 

Maybe if that's the case, the following approach could work:

Total Cases =
CALCULATE(
    COUNT( 'Case Record'[Case ID] ),
    ALLEXCEPT(
        'Case Record',
        'Case Record'[Week]
    ),
    'Case Record'[Case Type ID] = 1
)

 

It would be helpful to get more information or even better the file in order to help you.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @brian0782 ,

 

is the column "Week" also from the table 'Case Record'?

If yes, with the ALL you also remove the filter of Week, so every time you get the total.

 

Maybe if that's the case, the following approach could work:

Total Cases =
CALCULATE(
    COUNT( 'Case Record'[Case ID] ),
    ALLEXCEPT(
        'Case Record',
        'Case Record'[Week]
    ),
    'Case Record'[Case Type ID] = 1
)

 

It would be helpful to get more information or even better the file in order to help you.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

This worked well. Thanks for the explanation 😁

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.