The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All ,
I am struggling to find the soultion for the below problem statement.
I have to create a measure to calculate the %change from selected quarter range. For example, we have data of 2023 from each month with salesDate.
Input Data:
Month-Year | Quarter-Year | SalesAmount |
01-2023 | Q1-2023 | 10 |
02-2023 | Q1-2023 | 20 |
03-2023 | Q1-2023 | 30 |
04-2023 | Q2-2023 | 40 |
05-2023 | Q2-2023 | 50 |
06-2023 | Q2-2023 | 60 |
07-2023 | Q3-2023 | 70 |
08-2023 | Q3-2023 | 80 |
09-2023 | Q3-2023 | 90 |
10-2023 | Q4-2024 | 100 |
11-2023 | Q4-2024 | 110 |
12-2023 | Q4-2024 | 120 |
So when Q1-2023, Q3-2023 & Q4-2023 are selected from slicer, desired result should be i.e.
Quarter-Year | SalesAmount | % Change |
Q1-2023 | 60 | 0.0% |
Q3-2023 | 240 | 300% |
Q4-2023 | 330 | 37.5% |
but if only Q1-2023 & Q4-2023 are selected then the desired output should be
Quarter-Year | SalesAmout | % Change |
Q1-2023 | 60 | 0.0% |
Q4-2024 | 330 | 450% |
@Greg @HotChilli @bhanu @bhanu_gautam @lbendlin
Many thanks
Hi @nidhesh_tiwari one of the best way to solve this dynamic thing is by using offset formula.
Source data
Current Amount
Previous amount using offset function
When All qtr is selected
When Random Qtrs are selected
if this solves your problem then accept the same as your solution.
The simplest approach would be to use Visual Calculations ( particularly the PREVIOUS function). But you will want to invest in a proper data model first, with a proper calendar table.
User | Count |
---|---|
24 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |