The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Everyone,
I am currently a new user to PowerBi and I have reached a dead-end with the charting. I am trying to build a chart same as the below one, where when I choose a period in the slicer, it shows the chosen month + the previous months data. If someone can kindly assist me with it. I am looking at building the same chart as the below one. Thank you
Solved! Go to Solution.
Hi @MindlessH ,
Please follow the below steps to achieve it:
1. Create a fiscal year months table as below.
2. Create a calculated column to get the fiscal month order.
Nmonthorder =
CALCULATE (
MAX ( 'Fiscal year'[Order] ),
FILTER ( 'Fiscal year', 'Fiscal year'[Fiscal Month] = 'Table'[Month] )
)
3. Create 4 measures as below to get the the corresponding value_1, value_2, value_3 and value_4 in previous selected month.
Nvalue_1 =
VAR _sfMonth =
SELECTEDVALUE ( 'Fiscal year'[Fiscal Month] )
VAR sfmonthOrder =
CALCULATE (
SUM ( 'Fiscal year'[Order] ),
FILTER ( 'Fiscal year', 'Fiscal year'[Fiscal Month] = _sfMonth )
)
RETURN
CALCULATE (
SUM ( 'Table'[Value_1] ),
FILTER ( 'Table', 'Table'[Nmonthorder] <= sfmonthOrder )
)
Then you can select the month you want and get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MindlessH ,
Please follow the below steps to achieve it:
1. Create a fiscal year months table as below.
2. Create a calculated column to get the fiscal month order.
Nmonthorder =
CALCULATE (
MAX ( 'Fiscal year'[Order] ),
FILTER ( 'Fiscal year', 'Fiscal year'[Fiscal Month] = 'Table'[Month] )
)
3. Create 4 measures as below to get the the corresponding value_1, value_2, value_3 and value_4 in previous selected month.
Nvalue_1 =
VAR _sfMonth =
SELECTEDVALUE ( 'Fiscal year'[Fiscal Month] )
VAR sfmonthOrder =
CALCULATE (
SUM ( 'Fiscal year'[Order] ),
FILTER ( 'Fiscal year', 'Fiscal year'[Fiscal Month] = _sfMonth )
)
RETURN
CALCULATE (
SUM ( 'Table'[Value_1] ),
FILTER ( 'Table', 'Table'[Nmonthorder] <= sfmonthOrder )
)
Then you can select the month you want and get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
121 | |
86 | |
77 | |
55 | |
48 |
User | Count |
---|---|
136 | |
128 | |
78 | |
64 | |
63 |