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
guruprasathb
Regular Visitor

Calculate Number of Employees irrespective of filtered selection

Dear Power BI Experts,

 

Here is my scenario and I need valuable inputs.

 

Scenario:

1. I have a dataset which contains data from 1-1-2015 to till date.

2. I have a date filter on my dashboard (Slicer) - Which is DimDate Dataset

3. If user selected 01-10-2017 as start date & 31-10-2017 as end date. Then

4. I need to show total number of records from 1-1-2015 to 01-10-2017 as one of the KPI. 

 

Since in my Power BI data model, dataset & time have a relationship on transaction date. Because of that KPI is displayed while calculating the number of rows from 01-10-2017. Is there any workaround?

 

Thanks in Advance.

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@guruprasathb,

 

You may add CROSSFILTER Function outside and set cross-filter direction to None.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft, Sorry for the late reply. I think we are almost there but still need your expert advise.

 

Below are my scenario's.

1. Calculate the record count from 1-1-2015 to Start Date of the Slicer (i.e., 10-1-2017)

2. Calculate the record count from 1-1-2015 to End Date of the Slicer (i.e., 10-31-2017).

 

Below are the DAX I am using,

 

Start Count(M) =
    CALCULATE (DISTINCTCOUNT(EMPLOYEE[Employee Code]),CROSSFILTER(EMPLOYEE[Joining Date],DateDim[Date],None) )
 

Kindly let me know your inputs.

 

Thanks,

Guru

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 Kudoed Authors