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
CarlBlunck
Resolver I
Resolver I

ALL not working

Hello,

 

I'm trying to calculate something and I don't want this value to be changed when a specific filter is applied.  I've taken and applied the advice written in this Understanding DAX Auto-Exist - SQLBI blog, but still not having any luck.  Here is the measure:

 

TrendingHeadcount = 
VAR EOM = MAX(dim_PlacementDates[Date])
VAR SOM = MIN(dim_PlacementDates[Date])

RETURN

CALCULATE(DISTINCTCOUNT(fact_PlacementData[WamiKey]),
FILTER(fact_PlacementData,
(fact_PlacementData[HireDate]<= EOM && fact_PlacementData[TerminationDate]>=SOM) || 
(fact_PlacementData[HireDate]<= EOM && fact_PlacementData[TerminationDate]=BLANK())
),
ALL(dim_TerminationReasons[TerminationReasonDesc])
) 

 

Here is a snippet of the model where the 3 tables that are referenced in this formula are used:

CarlBlunck_0-1667973162380.png

 

Any ideas?

Thanks

Carl

2 REPLIES 2
CarlBlunck
Resolver I
Resolver I

Hi @amitchandak ,

 

Thanks for those.  Am applying the logic as suggested but I still can't get it to work 😞

 

Here is the model showing many-to-one relationships between the fact table and dim tables:

CarlBlunck_0-1668042525675.png

 

The measure I have used is:

TrendingHeadcount = 
VAR EOM = MAX(dim_PlacementDates[Date])
VAR SOM = MIN(dim_PlacementDates[Date])

RETURN

CALCULATE(DISTINCTCOUNT(fact_PlacementData[WamiKey]),
FILTER(fact_PlacementData,
(fact_PlacementData[HireDate]<= EOM && fact_PlacementData[TerminationDate]>=SOM) || 
(fact_PlacementData[HireDate]<= EOM && fact_PlacementData[TerminationDate]=BLANK())
),
ALL(dim_TerminationReasons)
) 

Here is the result of the measure with a MonthYear being selected and as you can see, it isn't producing the total against each row.

CarlBlunck_1-1668042954906.png

 

Then when I select a TerminationReasonDesc in the filter, it just gives me the result for that row and not the total result as desired.

CarlBlunck_2-1668043008367.png

 

Any ideas what I am doing wrong?

Thanks

Carl

 

amitchandak
Super User
Super User

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.