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

PowerBi Desktop : Previous Semester Number Employees Filter by Slicer

Hello , i did some research but i wasn't able to find or adapt a solution to my project.

 

So my goal is to create a Card that shows the number of employee of the previous semester based in the selection of the "Data" slicer .

 

SergioPalhais_0-1672064718491.png

 

SergioPalhais_1-1672064870650.png

 

As you can see i was able to create the "Measure 3" that shows the current data selection -6 months

 

Now i want to show the employee numbers using "Measure 3" or some equivalent, that is able to do it using the Date selected in the "Data" -6 months / 1 semester.

 

This is my table:

 

SergioPalhais_2-1672065003791.png

 

This is measure 3:

 

SergioPalhais_0-1672065303714.png

 

Then i want to show only "Banco Montepio" but that i think i can do it applying a normal filter "Empresa" to the card visual 

 

Thanks

1 ACCEPTED SOLUTION
SergioPalhais
New Member

ok , this is working now 

 

 CALCULATE(SUM(TrabalhadoresConverteBI[Ntrabalhadores]), FILTER(ALL(Semestres), 'Semestres'[SemesterRANK] =max(Semestres[SemesterRANK])-1))
For previous semester
 

Thanks

View solution in original post

3 REPLIES 3
SergioPalhais
New Member

ok , this is working now 

 

 CALCULATE(SUM(TrabalhadoresConverteBI[Ntrabalhadores]), FILTER(ALL(Semestres), 'Semestres'[SemesterRANK] =max(Semestres[SemesterRANK])-1))
For previous semester
 

Thanks
SergioPalhais
New Member

SergioPalhais_0-1672328108228.png

 

Still not working. I want to create a visual card that show the number of employees the previous semester of the one selected in the slicer, for example, with 30-06-2022 filter it will give me the employees of 31/12/2021 ( one semester before )


 

amitchandak
Super User
Super User

@SergioPalhais , Create a table with distinct semesters (Assume date or sortable column ). Join it back with you table.

 

Have rank on the semester start date 

A new column

semester  Rank = RANKX(all('Date'),'Date'[semester start date],,ASC,Dense)

 

These measures can help
This Week = CALCULATE(Count('Table'[Count]), FILTER(ALL('semester '),'semester '[semester Rank]=max('semester '[semester Rank])))
Last Week = CALCULATE(Count('Table'[Count]), FILTER(ALL('semester '),'semester '[semester Rank]=max('semester '[semester Rank])-1))

 

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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.