Forum Discussion
Getting Dates from Data into a Report Builder Report
- 1 year ago
I think I have figured out a solution.
For the Actual Last Year, I used MIN(Date), which, right now, is 6/30/24. For the three This Year columns, I'm using First(Fields!Date.Value, "DataSet1"). For future years, I'm taking the MIN(Date) and adding 2, 3, 4, etc. then adding the 6/30 portion.
Hi,
As per our understanding, to include the dates in the header for each column in a Report Builder table, while excluding the "Over/Under" (variance) column, you can achieve this by using expressions in the header row of the table.
Here’s how to add dynamic dates to the table header:
Steps to Add Dates Dynamically to Table Headers
Ensure Dates are Accessible:
- Verify that your dataset includes the required dates (6/30/2024, 9/30/2024, etc.) as fields or calculated columns.
Add a Header Row:
- Insert a row above the existing header row in the table if you don't already have a place for dates.
Use Expressions to Populate Dates:
- Click on the header cell where the date needs to appear (e.g., above the column "Actual Last Year").
- Right-click the cell and choose Expression.
Write the Expression for Each Column:
- Use conditional logic to fetch the correct date based on the column's context. For example:
- For "Actual Last Year":
=First(Fields!Date.Value, "YourDatasetName") ' Filter for 6/30/2024 data - For "Actual Current Year": =First(Fields!Date.Value, "YourDatasetName") ' Filter for 9/30/2024 data
- Repeat for other columns as needed.
- Replace "YourDatasetName" with the name of your dataset.
- For "Actual Last Year":
Exclude Variance Column:
- For the variance column ("Over/Under"), leave its header blank or set it to "Variance" manually.
Verify and Adjust:
- Preview the report to confirm the dates are correctly aligned.
- Ensure your dataset filters or calculations correctly match the fiscal year logic.
Thanks!
- callenbkd1 year agoHelper II
Thank you for the quick message.
While adding the expression isn't a problem, I think the answer is based on the date remaining as is. Is that right? I should have added that the data will be replaced each month. Until this fiscal year ends on 6/30/25, the Actual Current Year column date value will change from 9/30/24 to 10/31/24, etc. The dates for the other columns will remain the same until July 2025.
It seems like I could create a measure in Power BI to get the dates but I don't know how to write the expression. However, if it could be done using a calculated field or expression in Report Builder, I can use it.