Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ShayanSiddique
New Member

How can I display previous period dynamic data in Power BI without applying any aggregation?

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 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vjianpengmsft_0-1737616745228.png

The relationship between my date table and this fact table is as follows:

They are inactive relationships:

vjianpengmsft_1-1737616850885.png

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:

vjianpengmsft_2-1737617038335.png

Here are the results:

vjianpengmsft_3-1737617094647.png

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.

 

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

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.

vjianpengmsft_0-1737616745228.png

The relationship between my date table and this fact table is as follows:

They are inactive relationships:

vjianpengmsft_1-1737616850885.png

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:

vjianpengmsft_2-1737617038335.png

Here are the results:

vjianpengmsft_3-1737617094647.png

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.

 

 

 

 

ShayanSidddique
New Member

@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?

ShayanSidddique
New Member

@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?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
AmiraBedh
Super User
Super User

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 🙂


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
Ritaf1983
Super User
Super User

Hi @ShayanSiddique 

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.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.