The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Let's say I have the dataframe below. I want to create a Chart line with it. Y-Axis would the Return_A field. When it comes to X-Axis, I want the user to be able to select the data renge he wants by using fields StartDate and EndDate in 2 different slicers and still having a trend that is diplayed in the chart (Not a single point).
For example, if he choses 2023-12-31 as StartDate and 2024-01-10 as EndDate, logically, the chart will display only the point of intersection (1.09%). That is not what I want: I want to show the trend - all the points prior to 1.09%.
StartDate | EndDate | Return_A | Ret_Y | Period |
2023-12-31 | 2024-01-01 | 1% | 1.00% | YTD |
2023-12-31 | 2024-01-02 | 1.01% | 1.01% | YTD |
2023-12-31 | 2024-01-03 | 1.02% | 1.02% | YTD |
2023-12-31 | 2024-01-04 | 1.03% | 1.03% | YTD |
2023-12-31 | 2024-01-05 | 1.04% | 1.04% | YTD |
2023-12-31 | 2024-01-06 | 1.05% | 1.05% | YTD |
2023-12-31 | 2024-01-07 | 1.06% | 1.06% | YTD |
2023-12-31 | 2024-01-08 | 1.07% | 1.07% | YTD |
2023-12-31 | 2024-01-09 | 1.08% | 1.08% | YTD |
2023-12-31 | 2024-01-10 | 1.09% | 1.09% | YTD |
2023-12-31 | 2024-01-11 | 1.10% | 1.11% | YTD |
2023-12-31 | 2024-01-12 | 1.12% | 1.12% | YTD |
2023-12-31 | 2024-01-13 | 1.13% | 1.13% | YTD |
2023-12-31 | 2024-01-14 | 1.14% | 1.14% | YTD |
2023-12-31 | 2024-01-15 | 1.15% | 1.15% | YTD |
Hi @DataDada
We have not received a response from you regarding the query and were following up to check if you have found a resolution from the information provided below. If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.
Thank You!
Hi @DataDada
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @DataDada
We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.
If our response was helpful, please mark it as the accepted solution and give a kudos, as this helps other members in community.
Thank You!
Hi,
You could try something like this. In Power Query, select all columns other than the first one, right click and select "Unpivot Other Columns". Rename Value to Date. Create a Calendar Table and a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table. On the X axis, drag Date from the Calendar Table. Create a date slicer from the Calenar table and select a beg/end date.
The most simplest approach to this would be
Creating a line chart with y axis as Return_A and x axis should be End Dates.
Along with this line chart, under that chart - you need a sliding slicer of dates starting from 2023-12-31 and end as 2024-01-15 and then slide according to your requirement and the visual will respect that
Hi @DataDada ,
For this you need to have a disconnected table for date in order to select the start and end. and you should then use the following code:
Measure YTD = CALCULATE(SUM('Table'[Return_A]), 'Table'[EndDate] <= MAX('Calendar'[Date]))
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks Miguel Felix for your quick answer. I tried this way as well using this measure
Hi @DataDada,
This depends on how you setup the data you need to add the date has part of the visualization to get the correct value for each data point.
If you want to show a single value then the code need to be different.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português