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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
tomperro
Helper III
Helper III

How to use a slicer with Calculated Columns and Measures

It is my understanding that calculated columns do not interact with slicers and they are only calculated at either a refresh or the inital load.


I have several calculated columns in my BI report that I use to hold values (scores) and I am running into an issue where I need to look at previous data using a date slicer.  I am using calculated columns because I need to do other various calculations on the calculated column values, particularly for a roll up.  My calculated columns start at the employee and I need to roll up the calculations for employee, supervisor, zone, division, department.

 

For example, if I view the report with no date slicer, the calculated column is set to TRUE for employees that have a hire date 30 days prior to todays date. 

 

I need the ability to select a date range, last year (1/1/2023-12/31/2023) for example, and show me who was a new hire during that time frame. A new hire would be any employee that has a hire date 30 prior to my selected end date (12/312023).

2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi  @tomperro ,
Thanks for  @ray_aramburo  reply and reminder.
Can you provide some sample data? We can better understand the problem and help you. 
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

ray_aramburo
Super User
Super User

You can definitely use calculated columns as slicers and also they are affected by them, you CAN'T use measures as slicers (only as filters in the Filters pane in some cases).

For the specific example you mention, the New Hire set as True column will be independent to what you filter in your date range because in its creation you have specified that it needs to be 30 days prior to today. If you desired to view 30 days prior to the selected date on the slicer, you will need to create a measure and not a calculated column.





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.