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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
databot_kd
Helper II
Helper II

How to pass selected value from a slicer into a calculated column

Hi community, 

 

Please can you assist, is there a way to pass a selected value from a slicer into a calculated column?
I have tried SELECTEDVALUE but this only works in a Measure. 

 

I am trying to bring the selected date from my slicer (slicer set to single select) and pass that into a column so i can create an aging bucket based on the selected date? 


I was able to create the buckets using a measure how the measures then cant be used in a pivot as columns or stacked barchart as the columns. 

Thanks

4 REPLIES 4
Anonymous
Not applicable

Hi @databot_kd 

 

@Fowmy Thanks for your sharing!

 

Slicers can't be passed to calculated columns. Therefore, you cannot use the SELECTEDVALUE function in a calculated column, as it will return the same value for every row regardless of the slicer selection.

 

You can use the SELECTEDVALUE function in a measure, and then use that measure in a visual. And measure will change with the slicer. For example, you can create a measure like this:

vnuocmsft_0-1704766920513.png

 

Regards,

Nono Chen

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

 

 

Fowmy
Super User
Super User

@databot_kd 

While creating a table or calculated column in Power BI, capturing slicer selections in real-time isn't feasible. Power BI constructs tables and columns before making them available on the report canvas. To assist you more effectively, kindly explain your requirements clearly, furnish sample data, and outline the expected outcome. This will enable a tailored solution to meet your specific needs. An approach using Measures should work in your case.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy 

My requirement is to have a aging bucket column based off my selected date from the slicer. 

Example of what i need is below:

databot_kd_0-1704858641480.png

 

ReferenceIN DateTR DateAmount
1234AB10/12/202310/12/2023100
1234AC1/12/20231/12/2023120
1234AD11/11/202311/11/2023196
12A35498/10/20238/10/2023157
ASD78918/09/202318/09/2023233
1234AD11/09/202311/09/2023115
12A35505/08/20235/08/20231200
ASD79019/07/202319/07/2023173
1234AD6/06/20236/06/202320




Example calc im using to determine each bucket
IN DATE <  EOM(SELECTED DATE)  && TR DATE < EOM(SELECTEDDATE) && TR DATE > EOM(SELECTEDDATE, -1), "Current" 
ETC.. For 1 month, 2month etc

@databot_kd 

You need a dynamic aging calcualtion here, refer this article and make necessary chagnes: 
Dynamic Banding or Grouping in Power BI – Using DAX Measures – Choose the Size of Bins - RADACAD

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors