Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am working on a Power BI report and want to show data from the previous period dynamically based on the filters applied in the report. However, I do not want to apply any aggregation (e.g., SUM, AVERAGE) to the data. Instead, I want to display the raw data from the previous period in a table View while ensuring it adjusts dynamically with the filters and slicers applied to the report. What is the best way to achieve this in Power BI?
@PowerBI @dax @Powerbidesign @DataAnalysis
Solved! Go to Solution.
Thank you Ritaf1983 and AmiraBedh
Hi, @ShayanSiddique
Based on your description, I've created a small dataset to simulate your report. This dataset contains data for January 2024 and December 2024, January 2025 and February 2025.
The relationship between my date table and this fact table is as follows:
They are inactive relationships:
I created the following three measures:
Previous period Month = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),DATEADD('DateTable'[Date],-1,MONTH),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Previous period Year = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),DATEADD('DateTable'[Date],-1,YEAR),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Current Seleted period = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Filter the table visuals separately at the visual level:
Here are the results:
It correctly displays your forum information for the previous time period in aggregate situations.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Ritaf1983 and AmiraBedh
Hi, @ShayanSiddique
Based on your description, I've created a small dataset to simulate your report. This dataset contains data for January 2024 and December 2024, January 2025 and February 2025.
The relationship between my date table and this fact table is as follows:
They are inactive relationships:
I created the following three measures:
Previous period Month = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),DATEADD('DateTable'[Date],-1,MONTH),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Previous period Year = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),DATEADD('DateTable'[Date],-1,YEAR),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Current Seleted period = IF(NOT ISBLANK(CALCULATE(COUNTA('Table'[PostID]),USERELATIONSHIP(DateTable[Date],'Table'[PostDate]))),1,0)
Filter the table visuals separately at the visual level:
Here are the results:
It correctly displays your forum information for the previous time period in aggregate situations.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Ritaf1983 @AmiraBedh
I am creating a dashboard for social platforms to visualize page stats and posts within a selected date range. However, I am encountering an issue when trying to display posts from the previous period relative to the selected date range slicer. I’ve tried using measures, but they only return aggregated data, whereas I need to display the filtered rows for the previous date range. Calculated fields haven’t worked either, as they are not dynamic and do not respond to changes in the date slicer. How can I dynamically display posts in a table for the previous period based on the selected date range?
@Ritaf1983 My Question is this that I am creating a dashboard for social platforms to visualize page stats and posts within a selected date range. However, I am encountering an issue when trying to display posts from the previous period relative to the selected date range slicer. I’ve tried using measures, but they only return aggregated data, whereas I need to display the filtered rows for the previous date range. Calculated fields haven’t worked either, as they are not dynamic and do not respond to changes in the date slicer. How can I dynamically display posts in a table for the previous period based on the selected date range?
Is there Any Way to get it Done?
Can you share sample of your data ? your data model?
First thing in my mind, you need to have a date table in your model. Mark it as a date table in the "Model" view to use time intelligence functions effectively and make sure your fact table is related to the date table based on the date field.
You can add a calculated column in your date table to identify the dates for the previous period dynamically. For example, if you're working with months, create a column for the previous month dates.
Previous Period Date =
CALCULATE(
MAX('Date'[Date]),
DATEADD('Date'[Date], -1, MONTH)
)
Keep in mind that aggregations are the core of the BI in the word Power BI.
Having only tabular data in a report can be a nightmare if the data is huge 🙂
The difference between aggregated and non-aggregated values in Power BI depends on how the data is filtered and presented. For your scenario, where you want to display previous period data dynamically without aggregation in a table view, follow these steps:
Dynamic Filtering Without Aggregation: Instead of creating a standard DAX measure (e.g., SUM or AVERAGE), create a flag measure in DAX. This measure should return TRUE when the period belongs to the selected previous period range. This allows you to filter data dynamically without applying any aggregation.
For example :
PreviousPeriodFlag =
IF(
'Calendar'[Date] IN DATESBETWEEN(
'Calendar'[Date],
PREVIOUSMONTH(MIN('Calendar'[Date])),
PREVIOUSMONTH(MAX('Calendar'[Date]))
),
TRUE(),
FALSE()
)
Use this flag measure to filter your table visual, ensuring it only displays rows from the previous period.
Understanding Filtering Logic: To better understand how filtering logic works, you might find tutorials or videos helpful that explain how to create custom period slicers or filters in Power BI.
https://www.youtube.com/watch?v=fKygF7VEJnQ
If you encounter difficulties implementing the solution, I recommend creating a small example PBIX file. In this file, include a simplified dataset and demonstrate the desired outcome. You can then share the file via a public cloud service (like OneDrive or Google Drive) and provide the link. This will help others troubleshoot your issue more effectively.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
39 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |