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
dinesh1393
New Member

DAX Filter returns invalid results

I have the measures. In the PR_SPL_DATE_CHANGED measure, the filter is returning null records of LEFT(Products[RUN_DATE],4) along with the matching records. I expect this should return only for (Products[RUN_DATE],4) = LEFT([MIN_RUN_DATE],4) condition whereas the null records also being filtered out from this. I dont know what is the reason behind this.

 

 

 

 

MIN_RUN_DATE = CALCULATE(MIN(Products[RUN_DATE]), LEFT(Products[RUN_DATE],4) = FORMAT(YEAR(TODAY()),BLANK()))
 
PR_SPL_DATE_CHANGED = IF((CALCULATE(COUNTROWS(VALUES(Products[PR_SPL_SALES_DATE])),
FILTER(Products, LEFT(Products[RUN_DATE],4) = LEFT([MIN_RUN_DATE],4)))) = 1,0,1)

 

 

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @dinesh1393 ,

 

Here I create a sample file to have a test.

veqinmsft_0-1684918705775.png

Your code works well on myside.

veqinmsft_1-1684918823545.png

Here I have some questions. I am confused that whether [RUN_DATE] and [PR_SPL_SALES_DATE] are text data format.

I think your calculation is based on your data model, please share a sample file with me and show me a sceenshot with the result you want. This will make it easier for me to find the solution.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.