Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rpattan
Advocate I
Advocate I

Current Period minus Parallel Previous period Percentage change calculation

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 1In Detail: If an user selected January month then the result shall be;
((January 2018 - January 2017)/January 2017)*100
Case 2If an user selected Year wise then the result shall be;
((Year 2018 - Year 2017)/Year 2017)*100
Case 3If an user selected Q1 Quarter then the result shall be;
((Q1 2018 - Q1 2017)/Q1 2017)*100
Case 4If an user seleted with a date then the result shall be;
((Selected date - Parallal Previous date)/Parallal Previous date)*100

 

Data Table: 

S.NoNameTitleDateCount
1BrianA17/31/20171
2JossA27/31/20171
3AndyA37/31/20171
4BobB28/3/20171
5DavidB39/15/20171
6JamieA110/13/20171
7ChiruA210/13/20171
8RajendraA310/13/20171
9DavidB111/15/20171
10JamieB211/30/20171
11ChiruB312/4/20171
12RajendraB312/13/20171
13ChiruA11/31/20181
14RajendraA22/5/20181
15DavidA32/28/20181
16JamieB13/6/20181
17BrianB24/11/20181
18JossB39/6/20171
19AndyA19/27/20171
20BobA212/26/20171
21DavidA312/26/20171
22ChiruB18/10/20171
23RajendraB28/31/20171
24DavidB312/4/20171
25JamieA112/13/20171
26BrianA21/31/20181
27JossA32/5/20181

 

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

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

 

Does this work?

 

=SUM(Data[Count])/CALCULATE(SUM(Data[Count]),SAMEPERIODLASTYEAR('Date'[Date]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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

 

YearTotal Badges 
2017838 
2018491 
   
 FormulaResult
Year :(491 - 838)/838*100-41.4%
MonthI shall be compute as above 
QuarterI 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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

 

Thank you Ashish for your time and patience. Smiley Happy

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens Thanks for the reference. useful cases available.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.