Forum Discussion
Calculated columns and slicer value
- Anonymous4 years ago
Hi Anonymous
Calculated column values are not responsive to filter selection or parameters. So if you want to return a dynamic value filtered by slicer , my suggestion is to create a measure instead of calculated column.
(1)Create a calendar date table to return a date column .
Calendar Date = CALENDAR(DATE(2021,12,28),DATE(2021,12,31))(2)Add a slicer with field 'Calendar Date'[Date] ,then you can filter data table with the dynamic date .
(3)Create a measure with the dynamic date from Calendar Date table.
Measure = IF(SELECTEDVALUE('Table'[Exp.date_q])=BLANK(),SELECTEDVALUE('Table'[Product_y]), IF(and(SELECTEDVALUE('Calendar Date'[Date])>SELECTEDVALUE('Table'[Exp.date_y]),SELECTEDVALUE('Calendar Date'[Date])<SELECTEDVALUE('Table'[Exp.date_q])),SELECTEDVALUE('Table'[Product_y]), IF(SELECTEDVALUE('Calendar Date'[Date])>SELECTEDVALUE('Table'[Exp.date_q]),SELECTEDVALUE('Table'[Product_m]))))The final result is as shown :
I have attached my pbix file , you can refer to it.
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , You need to dynamic segmentation of binning
check example
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-size-of-bins
https://www.credera.com/blog/technology-solutions/creating-aging-report-using-a-user-selected-date-in-power-bi/
https://www.daxpatterns.com/dynamic-segmentation/
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.