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
brcnyc
Frequent Visitor

dax formula not working(was working on excel)

Hi, I have had a dax formula which was working when I was working in excel with the same data. Now, I've uploaded the same data and tried to apply the same dax formula but it didn't work. Can you help me please? My formula is: =CALCULATE(COUNT([Pers.no.]);FILTER(ALL('DATASET'[Data Tarihi]);[Data Tarihi]=MAX([Data Tarihi])))

 

persn.no: number 

data tarihi:date

 

 

 

 

1 ACCEPTED SOLUTION

Try this

 

Measure =
CALCULATE (
    COUNT ( [Pers.no.] );
    FILTER ( ALL ( 'DATASET' ); 'DATASET'[Data Tarihi] = MAX ( 'DATASET'[Data Tarihi] ) )
)

 

If it is still failing, we will need to see what your model and sample data looks like.

 

Hope this helps

David

View solution in original post

5 REPLIES 5
dedelman_clng
Community Champion
Community Champion

Hi @brcnyc - please be more specific on what "not working" means. Does it give an error? Is it not showing the expected answers? Please share what Excel looks like where it works. Any other information about the data model and sample data would be helpful as well.  See this link: How-to-Get-Your-Question-Answered-Quickly 

 

David

Hi, yes I get an error message:  A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed." In my excel workbook, I was using this formula. I had an HR dashboard. This formula was showing the number of head counts for the last month even if you do not choose the latest month from a filter.  because the formula was = max(date) as I've shown above.

 

@dedelman_clng 

Try this

 

Measure =
CALCULATE (
    COUNT ( [Pers.no.] );
    FILTER ( ALL ( 'DATASET' ); 'DATASET'[Data Tarihi] = MAX ( 'DATASET'[Data Tarihi] ) )
)

 

If it is still failing, we will need to see what your model and sample data looks like.

 

Hope this helps

David

I did it thank you very much 🙂

Thank you very much for your help, but it didn't work. It shows empty. I attached the photos of my data. What I want to do here is, the formula should show the head count numbers for the latest date in the data (which is 01.06.2020 in the data).11.JPG12.JPG

 

@dedelman_clng 

 

 

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.

Top Solution Authors