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
DebbieE
Community Champion
Community Champion

DAX Percentage to find proportion against a slicer with a date flag set

Im really struggling with a bit of DAX at the moment

 

PercentageControlStrat.JPG

%  = [Number ]/CALCULATE([Number ],ALLSELECTED('Metrics'))
this is great, obviously until I filter
 

FilteredWrong.JPG 

I want to see them all. As an Addition I have a Filter on this visual containing a flag for Previous year against the date table

 

I tried this DAX 

 

% by month (against All ) = [Number]/
CALCULATE([Number],
ALL(DimTable))
 
And this worked  fine without the flag 
WorkswithoutFlag.JPG
But when I add in the flag from the date time table it goes wrong
 
FlagAddedIn.JPG
this is obviously because I dont have anything about month in the DAX.
I have tried a number of things. ALLEXCEPT etc and I just cant figure out how to get this one working
 
Any help on a solution would be appreciated, I feel like Im almost there
 
 
 

 

 

1 ACCEPTED SOLUTION
DebbieE
Community Champion
Community Champion

SORTED

 

%  month (against All ) = [Number]/
CALCULATE([Number],
FILTER( ALL('Date'),'Date'[Previous Month Flag] = TRUE()),
ALL(DimTable))
 
I think I even understand how this works
 
Thanks all
 
 

View solution in original post

13 REPLIES 13

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.