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
mmills2018
Helper IV
Helper IV

Issue with Data Slicer

Hello,

 

i have a slicer for Month/year, when i filter this slicer i am expecting my data to pull for the appropriate month selected.  Some of my data are measures with a date calculation (the date table is unrelated).  The issue I am running into, is that my data is only pulling YTD, so when i filter for June the data looks good but when i filter for May, it still keeps my June data.  below is my measure, any ideas what i am doing wrong?  I am assuming it has to do with a relationship of the filter?

 

 

Stage 4a Actual test =
var maxmonth= LASTDATE('Consolidated Talent Snapshot (2)'[Data as of])
return
CALCULATE(DISTINCTCOUNTNOBLANK('Consolidated Talent Snapshot (2)'[Associate ID]), 'Consolidated Talent Snapshot (2)'[In Talent for Job Family]="true", maxmonth)+0
4 REPLIES 4
HashamNiaz
Solution Sage
Solution Sage

Hi @mmills2018 !

 

Please make following changes to your DAX code;

 

Stage 4a Actual test =
var maxmonth= MAX('Consolidated Talent Snapshot (2)'[Data as of])
return
CALCULATE(DISTINCTCOUNTNOBLANK('Consolidated Talent Snapshot (2)'[Associate ID]), 'Consolidated Talent Snapshot (2)'[In Talent for Job Family]="true", maxmonth)+0

 

Regards,

Hasham

Hi @mmills2018 !

 

Lets try to simplify DAX a bit and use following;

 

Stage 4a Actual test =
var maxmonth= MAX('Consolidated Talent Snapshot (2)'[Data as of])
return
CALCULATE(DISTINCTCOUNTNOBLANK('Consolidated Talent Snapshot (2)'[Associate ID]), FILTER('Consolidated Talent Snapshot (2)', 'Consolidated Talent Snapshot (2)'[Data as of = maxmonth)) + 0

 

I have removed the filter for Job Family, please check if the above DAX works, we can append that filter back again.

 

Regards,

Hasham

Hi Hasham,

 

did you get a chance to look into this?

thanks, when i change 'lastdate' to 'Max" i get the below error2021-06-22_8-47-50.png

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.