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.
Hi,
As a slicer value cannot be passed on to calculated column to make it dynamic, what would be the best work-around to below issue?
The column "Report_product" should be dependable on the date selected in the Date-slicer. In below example I have used today's date, but the date would need to be dynamic in order to be able to report historical numbers correctly.
Br, Chris
Solved! Go to Solution.
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.
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.
@v-yetao1-msft Hi, thanks a lot, your suggested solution works fine in obtaining the correct names for the product depending on the selected date. Next step is to add data to the visual from another table based on the product names in the measure, how would that measure look like? (relationship between the measure and column?)
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
46 | |
31 | |
30 | |
18 | |
18 |