Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am working on a tabular cube.
My dashboard shows all summarized data (Fact Table 1) based on the snapshot date (1st day of each month - 05/01/2021,04/01/2021 etc.)
Based on the selected snapshot date, the users would also like to see the related sales data (Fact Table 2) from past three months.
e.g. If 1st May 2021 is selected in Fact Table 1, then user would like to see 3 months (1st Feb-1st May 2021) of sales lines data. They would like to see all row level sales information for past 3 months. If 1st April 2021 is selected, then it should show sales from 1st Jan -1st April.
There is no corelation between the date table of Fact table 1 and Fact table 2. Is there a way, I can pass date parameter values to Fact 2 to filter data for past 3 months?
Thanks in advance.
Solved! Go to Solution.
Hi, @PPD
You could create a measure by the following formula:
flag =
VAR _diff =
DATEDIFF ( MAX ( 'Fact Table 2'[date] ), MAX ( 'Fact Table 1'[Date] ), MONTH )
RETURN
IF ( _diff <= 3 && _diff > 0, 1 )
Then apply Flag measure to Filter:
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @PPD
You could create a measure by the following formula:
flag =
VAR _diff =
DATEDIFF ( MAX ( 'Fact Table 2'[date] ), MAX ( 'Fact Table 1'[Date] ), MONTH )
RETURN
IF ( _diff <= 3 && _diff > 0, 1 )
Then apply Flag measure to Filter:
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your response.
Hi,
See if my solution here helps - Flex a Pivot Table to show data for x months ended a certain user defined month.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
64 | |
60 | |
51 | |
36 | |
36 |
User | Count |
---|---|
81 | |
72 | |
58 | |
45 | |
44 |