The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Dear Friends,
Could any one look into my need.
I don't know where to start, but if you read the below "Data Table", hope you could understand easily. Out of the below data table I'm looking for "Percentage change over Parallal previous period". I'm writing the cases over here. And the percentage arriving formula is as below;
((After Value – Before Value) / Before Value) * 100 |
Case 1 | In Detail: If an user selected January month then the result shall be; ((January 2018 - January 2017)/January 2017)*100 |
Case 2 | If an user selected Year wise then the result shall be; ((Year 2018 - Year 2017)/Year 2017)*100 |
Case 3 | If an user selected Q1 Quarter then the result shall be; ((Q1 2018 - Q1 2017)/Q1 2017)*100 |
Case 4 | If an user seleted with a date then the result shall be; ((Selected date - Parallal Previous date)/Parallal Previous date)*100 |
Data Table:
S.No | Name | Title | Date | Count |
1 | Brian | A1 | 7/31/2017 | 1 |
2 | Joss | A2 | 7/31/2017 | 1 |
3 | Andy | A3 | 7/31/2017 | 1 |
4 | Bob | B2 | 8/3/2017 | 1 |
5 | David | B3 | 9/15/2017 | 1 |
6 | Jamie | A1 | 10/13/2017 | 1 |
7 | Chiru | A2 | 10/13/2017 | 1 |
8 | Rajendra | A3 | 10/13/2017 | 1 |
9 | David | B1 | 11/15/2017 | 1 |
10 | Jamie | B2 | 11/30/2017 | 1 |
11 | Chiru | B3 | 12/4/2017 | 1 |
12 | Rajendra | B3 | 12/13/2017 | 1 |
13 | Chiru | A1 | 1/31/2018 | 1 |
14 | Rajendra | A2 | 2/5/2018 | 1 |
15 | David | A3 | 2/28/2018 | 1 |
16 | Jamie | B1 | 3/6/2018 | 1 |
17 | Brian | B2 | 4/11/2018 | 1 |
18 | Joss | B3 | 9/6/2017 | 1 |
19 | Andy | A1 | 9/27/2017 | 1 |
20 | Bob | A2 | 12/26/2017 | 1 |
21 | David | A3 | 12/26/2017 | 1 |
22 | Chiru | B1 | 8/10/2017 | 1 |
23 | Rajendra | B2 | 8/31/2017 | 1 |
24 | David | B3 | 12/4/2017 | 1 |
25 | Jamie | A1 | 12/13/2017 | 1 |
26 | Brian | A2 | 1/31/2018 | 1 |
27 | Joss | A3 | 2/5/2018 | 1 |
Note: The "Count " column tells you that each person got one title at a perticular date. For SUM purpose I created.
----------------------------------------------------------------------------------------------------------------
Tried DAX formula: (But failed to get the result):-
Percentage Change =
VAR CurrentSA = [Count Sum]
RETURN
IF (
ISFILTERED ( 'Date'[Date].[Date] ),
CurrentSA
- CALCULATE ( [Count Sum]- PARALLELPERIOD ( 'Date'[Date], -1, YEAR )/PARALLELPERIOD ( 'Date'[Date], -1, YEAR ) ),
IF (
ISFILTERED ( 'Date'[Date].[Date] ),
CurrentSA
- CALCULATE ( [Count Sum]- PARALLELPERIOD ( 'Date'[Date], -1, QUARTER )/PARALLELPERIOD ( 'Date'[Date], -1, QUARTER ) ),
IF (
ISFILTERED ( 'Date'[Date].[Date] ),
CurrentSA
- CALCULATE ( [Count Sum]- PARALLELPERIOD ( 'Date'[Date], -1, MONTH )/PARALLELPERIOD ( 'Date'[Date], -1, MONTH ) ),
IF (
ISFILTERED ( 'Date'[Date] ),
CurrentSA
- CALCULATE ( [Count Sum], 'Date'[Date] - 1 )
)
)
)
)
--------------------------------------------------------------------------------------------------------
Your time is much more important to me aswell. Please try...Thanks
Riyaz
Solved! Go to Solution.
Hey,
are you aware of this site: https://www.daxpatterns.com/time-patterns/
If it doesn't help, please describe what pattern you were using and why it doen't work.
Hopefully this provides some additional ideads
Regards
Tom
Hi,
The formula is not working because there is a time stamp appeaing the Date column of the Badges - Copy table. Go to Home > Edit Queries and change the format of the date column to Date only. Click on Close and Load.
Hi,
Does this work?
=SUM(Data[Count])/CALCULATE(SUM(Data[Count]),SAMEPERIODLASTYEAR('Date'[Date]))
Hi Ashish,
It actually did not work.
If an user selected January 2018 month then the result shall be;
((January 2018 - January 2017)/January 2017)*100
Can you provide based on above requirement. Thanks
Hi,
It should work. Share the link from where i can download your PBI file.
Hi Ashish,
Thanks for your time.
For data intigrity policy I have changed the names and the rest are same.
https://drive.google.com/open?id=1z_dVeJCNGbljQS2tSFvIshMB2u43kfoY
Thanks in Advance.
Riyaz
Just adding what I am looking for. Thanks
Year | Total Badges | |
2017 | 838 | |
2018 | 491 | |
Formula | Result | |
Year : | (491 - 838)/838*100 | -41.4% |
Month | I shall be compute as above | |
Quarter | I shall be compute as above |
Hi,
The formula is not working because there is a time stamp appeaing the Date column of the Badges - Copy table. Go to Home > Edit Queries and change the format of the date column to Date only. Click on Close and Load.
Thank you Ashish for your time and patience.
You are welcome.
Hey,
are you aware of this site: https://www.daxpatterns.com/time-patterns/
If it doesn't help, please describe what pattern you were using and why it doen't work.
Hopefully this provides some additional ideads
Regards
Tom
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 June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
83 | |
64 | |
58 |
User | Count |
---|---|
248 | |
123 | |
112 | |
79 | |
78 |