Forum Discussion
Bar/line chart show all dates through selected date
I have a bar/line chart with daily transaction totals (as the bars) and transaction type % (as lines). I want the chart to show all dates through the date selected in a slicer. Currently, it is showing only the month selected in the slicer. How do I do this?
Thanks!
2 Replies
- Greg_Deckler
Community Champion
StaceyG So typically you need to use a measure to do this where the measure overrides the filter context set by the slicer. Very little to go on. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. - StaceyG
Helper I
I have a table with fields like Date, Total_Transactions, Verified_Trx, Verified%, Recapture_Trx, Recapture%, Submission_Error_Trx, Submission_Error% I want a chart where the bars are total transactions, and there are lines representing Verified%, Recapture%, and Submission_Error%. There is a date slicer with the month end dates from a related date table. When a month end date is selected, the chart needs to show all dates up to the month end date selected. However, the result has been that the dates reflected in the chart represent only the month for the month end date selected, rather than all history to that point.
I tried the suggestion of creating a second date table (Calendar) which has an inactive 1-to-many relationship with the Date table.
I then created measures like the following:
Total Trx Measure =VAR MonthEndDate = SELECTEDVALUE('Date'[MonthEndDate])VAR SelPeriods = CALCULATETABLE(VALUES('Calendar'[Date]), 'Calendar'[MonthEndDate]<=MonthEndDate)RETURNCALCULATE(SUM(MonthlyTrx[TOTAL_TRANSACTIONS]), REMOVEFILTERS('Date'), KEEPFILTERS(SelPeriods), USERELATIONSHIP('Date'[Date], 'Calendar'[Date]))However, when I used the Calendar(Date) field as my x-axis, it only drills down as far as the month end date, rather than each day of the month. I confirmed the date field used on the x-axis is the actual date, not the month end date.This approach seems to be getting me closer as it is bringing in prior months, but I need it to go down to the actual day (so I can drill through year, quarter, month, day).
Do you have any suggestions?