Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
As requested, attached are some images of the data.
Below are the results I am expecting
Please see below attached screenshots of visual data.
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
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
As requested, attached are some images of the data.
Below are the results I am expecting
Please see below attached screenshots of visual data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |