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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
setis
Post Partisan
Post Partisan

Help with "ALL" in a Matrix

Dear experts,

I am struggling trying to use ALL in a measure in my matrix:

header.PNG

 

My column hierarchy looks like this:

column hierarchy.PNG

 

The desired result is 1139 on all the cells for the second row (the total nr of cases for the selected week)

 

I've tried a lot of different things. The last attempt:

NrCasesForecastedThisWeekALL =
CALCULATE (
    [# Cases Forecast -NoSL];
    ALL ( 'Date'[WeekDayNumber]; 'Date'[Week Day]; 'Date'[Date] )
)

With this I'm getting the same result as you can see above. 

 

I have tried this as well

AllCases = CALCULATE([# Cases -NoSL] ; ALLEXCEPT('Date';'Date'[Calendar Week]))

but the result is not correct. 

 

Thank you in advance!

1 ACCEPTED SOLUTION

Dear @AlB Thanks a lot for reaching out 🙂

 

The measure is a simple DISTINCTCOUNT for IDs.

 

I actually made it work like this:

CALCULATE([# Cases Forecast -NoSL] ; ALLEXCEPT('Date'; 'Date'[Calendar Week] ; 'Date'[Calendar Year]))

I was using a slicer for the calendar year in the page and that had to be included in the measure. 

 

Thanks for your quick response!

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @setis 

Can you show the code for the measure and perhaps the structure of the tables involved, including relationships? To start with, wouldn't you need an ALL on 'Date'[Calendar week] as well? 

NrCasesForecastedThisWeekALL =
CALCULATE (
    [# Cases Forecast -NoSL];
    ALL ( 'Date'[WeekDayNumber]; 'Date'[Week Day]; 'Date'[Date];'Date'[Calendar Week] )
)

 

Dear @AlB Thanks a lot for reaching out 🙂

 

The measure is a simple DISTINCTCOUNT for IDs.

 

I actually made it work like this:

CALCULATE([# Cases Forecast -NoSL] ; ALLEXCEPT('Date'; 'Date'[Calendar Week] ; 'Date'[Calendar Year]))

I was using a slicer for the calendar year in the page and that had to be included in the measure. 

 

Thanks for your quick response!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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