Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nicolaslemerle
Regular Visitor

Filter on the last date result by Workplace

Hi the community 🙂

 

i have a question on a report power bi
We does security audits workplaces


I have a table with information workplace/date and result Audit, if need i have too the list complety workplaces

nicolaslemerle_0-1678099892418.png

 

on my power bi i have a map to site and i would display the last result by workplace, i have used the card for display the result

nicolaslemerle_1-1678099903499.png

 

i can't found (between M-query or Dax-Query) the solution for that 

 

can you help me ? 

thanks 

1 ACCEPTED SOLUTION
MAwwad
Super User
Super User

 

Yes, I can help you with that.

To display the last result by workplace in Power BI, you can use the following DAX formula:

 

 
Last Result = VAR MaxDate = MAX('Table'[Date]) RETURN CALCULATE(MAX('Table'[Result]), FILTER('Table', 'Table'[Date] = MaxDate))
 

Replace 'Table' with the name of your table and 'Date' and 'Result' with the names of your columns for date and result, respectively. This formula will calculate the maximum date for each workplace and then return the result for that date.

You can then use this DAX formula in a table or visual to display the last result by workplace. For example, you can create a table with the workplace name and the last result using the above formula.

View solution in original post

2 REPLIES 2
MAwwad
Super User
Super User

 

Yes, I can help you with that.

To display the last result by workplace in Power BI, you can use the following DAX formula:

 

 
Last Result = VAR MaxDate = MAX('Table'[Date]) RETURN CALCULATE(MAX('Table'[Result]), FILTER('Table', 'Table'[Date] = MaxDate))
 

Replace 'Table' with the name of your table and 'Date' and 'Result' with the names of your columns for date and result, respectively. This formula will calculate the maximum date for each workplace and then return the result for that date.

You can then use this DAX formula in a table or visual to display the last result by workplace. For example, you can create a table with the workplace name and the last result using the above formula.

Thanks for your speedy answer.

I tried, it work so thank for that too 🙂

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors