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
gilr1975
Helper I
Helper I

Present the last month data

Hello,

 

I have Months slicer.

I have a table with Emp.Id, Accumulated sickness dates and their ranges:

 

Emp.IdMonthsAccumulates Sickness daysSickness ranges
100Jan0%0%-1.5%
100Feb1.4%0%-1.5%
100Mar2.5%1.5-3%
100April1.8%1.5-3%
100May1.1%0%-1.5%
 

etc.

 

 

I would like to present a visual table/chart with the last month Accumulates sickness days.

E.g If I choose in slicer January-March I would like to present 2.5%. 

If I choose in slicer January-April I would like to present 1.8%. 

 

How can I do it?

 

 

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@gilr1975 

 

I suggest you to add a date column

1.PNG

Measure = 
VAR d=max('Table'[date])
Return maxx(FILTER('Table','Table'[date]=d),'Table'[accumulates])

2.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@gilr1975 

 

I am not sure how your data looks like. You still want the number of max month? Are there duplicated employees in the table for each month?

 

I created test data.

1.PNG

Measure = 
VAR d=max('Table'[date])
Return calculate(DISTINCTCOUNT('Table'[employee]),FILTER('Table','Table'[date]=d))

2.PNG

 

It will be better if you share the excel screenshot of your data structure and expected results.

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Tahreem24
Super User
Super User

@gilr1975 ,

You can use the below Measure:

MAX  = CALUCLATE(MAX(TableNAme[Accumulates]),FILTER(TableName,MAX(TableName[Months])))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
ryan_mayu
Super User
Super User

@gilr1975 

 

I suggest you to add a date column

1.PNG

Measure = 
VAR d=max('Table'[date])
Return maxx(FILTER('Table','Table'[date]=d),'Table'[accumulates])

2.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu 

Thank you so much!

One more question:

I also need to present the number of employees per ranges. 

I have a range table with their min and max, but it counts all employess for all months and I need only number of employees for the last selected month.

How can I do it?

@gilr1975 

 

I am not sure how your data looks like. You still want the number of max month? Are there duplicated employees in the table for each month?

 

I created test data.

1.PNG

Measure = 
VAR d=max('Table'[date])
Return calculate(DISTINCTCOUNT('Table'[employee]),FILTER('Table','Table'[date]=d))

2.PNG

 

It will be better if you share the excel screenshot of your data structure and expected results.

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




thanks a lot.

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.