The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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:
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@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.
⭕ 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:
Reference | IN Date | TR Date | Amount |
1234AB | 10/12/2023 | 10/12/2023 | 100 |
1234AC | 1/12/2023 | 1/12/2023 | 120 |
1234AD | 11/11/2023 | 11/11/2023 | 196 |
12A3549 | 8/10/2023 | 8/10/2023 | 157 |
ASD789 | 18/09/2023 | 18/09/2023 | 233 |
1234AD | 11/09/2023 | 11/09/2023 | 115 |
12A3550 | 5/08/2023 | 5/08/2023 | 1200 |
ASD790 | 19/07/2023 | 19/07/2023 | 173 |
1234AD | 6/06/2023 | 6/06/2023 | 20 |
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
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group