Forum Discussion
Dynamic Measure as per selection (In my case Date selection)
- 2 years ago
This is what i have been able to come up with. PBi file attached.
Hi The8 ,
Yes, it is indeed possible to implement this functionality in Power BI using DAX to create dynamic metric values in response to slicer selections. You can follow the steps below to create a dynamic metric that calculates savings based on date selection:
1.Make sure you have a table of dates that covers all the dates you are interested in. This table should be labelled as a "Date" table in Power BI. You can learn how to create it here:
Auto date/time guidance in Power BI Desktop - Power BI | Microsoft Learn
2.Ensure that there is a relationship between the date table you create and the table that contains the "cost savings" data based on the date columns.
3.Create a DAX metric that calculates savings based on the selected dates.
Dynamic Savings =
VAR SelectedDate =
SELECTEDVALUE ( 'Date'[Date] )
RETURN
CALCULATE ( SUM ( 'Table'[Cost saving] ),
Filter( 'Table' , 'Table'[Date] = SelectedDate )
4. Add a slicer to the report based on the Date column in the Date table. This slicer will allow the user to select a date and the Dynamic Savings metric will be calculated based on this selection.
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.