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.
Hi, I am developing week on week, month to date and Year to date financial Power bi report.
Below is the scenario that I am trying to develop
- Provided financial week, financial period and year slicer
- When user select a current week in slicer my matrix table categorised by product should show sales income for selected week and previous week, I acheived this by using below Dax queries
Solved! Go to Solution.
Hi @Anonymous
As requested, attached are some images of the data.
Below are the results I am expecting
Please see below attached screenshots of visual data.
Matrix table with two columns, one is current month (CM) and another column Previous month (PM)
Month slicer
Hi @RJ_KON ,
You can update the formula of measure [PreviousMonth] as below and check if it can return your expected result...
PreviousMonth =
VAR _periodrank =
SELECTEDVALUE ( 'Dim_Calendar MT'[PeriodRank] )
VAR _weekrank =
CALCULATE (
MIN ( 'Dim_Calendar MT'[WeekRank] ),
FILTER (
ALL ( 'Dim_Calendar MT' ),
'Dim_Calendar MT'[PeriodRank] = _periodrank
)
)
RETURN
CALCULATE (
[VNI],
FILTER (
ALL ( 'Dim_Calendar MT' ),
'Dim_Calendar MT'[PeriodRank] = _periodrank - 1
&& 'Dim_Calendar MT'[WeekRank] >= _weekrank - 2
&& 'Dim_Calendar MT'[WeekRank] <= _weekrank - 1
)
)
If the above one is not working, could you please provide some raw data in your fact table and the table 'Dim_Calendar MT' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, is there any relationship between your fact table and the table 'Dim_Calendar MT'? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
@Anonymous,
Thanks for the formulae, but from period slicer when user select period 10, so for previous week which is period 9 it is returning only two weeks value according to the above formulae, but I would like to see full period 9 weeks value.
RJ_KON
Hi @RJ_KON ,
What's your final expected result? When user select period 10, the visual need to display the data which the period is 9? Could you please provide some sample data and special example to explain your expected result? Thank you.
Best Regards
Hi @Anonymous
As requested, attached are some images of the data.
Below are the results I am expecting
Please see below attached screenshots of visual data.
Matrix table with two columns, one is current month (CM) and another column Previous month (PM)
Month slicer
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 |
---|---|
72 | |
71 | |
56 | |
38 | |
35 |
User | Count |
---|---|
85 | |
66 | |
59 | |
46 | |
45 |