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

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.

Reply
zawlh
Helper I
Helper I

Calculating Percent Change Without Date/Time

Hey everyone,
Please help me with one issue. I would like to know the percent change of my sheet.
LINK is here https://docs.google.com/spreadsheets/d/1jIHEFFkpcD6pGQ3cvag0KSB3fqNMZPSZasTHZE2cJWU/edit#gid=0

I would like to use Course Name in X-AXIS and Count of User ID in Y-AXIS.

 

What I want in my report is to show percent change from Course1 to Course2, Course2 to Course3,Course3 to Course4,etc,...

When I search on google, all percent change formula include Date or Time. I saw Tableau can do percent change with built-in function. I hope one of specialist here can teach me how to do it in power BI.
With Thanks,
Power BI Newbie

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @zawlh 

try a measure like

Measure = 
var _curCourseCount = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Course Name]))
var _prevCourse = CALCULATE(MAX('Table'[Course Name]),FILTER(ALL('Table'),'Table'[Course Name]< SELECTEDVALUE('Table'[Course Name])))
var _prevCourseCount = CALCULATE(COUNTROWS('Table'),ALL('Table'),'Table'[Course Name]=_prevCourse)
return
IF(_prevCourseCount=0,BLANK(),DIVIDE(_curCourseCount,_prevCourseCount)-1)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @zawlh 

try a measure like

Measure = 
var _curCourseCount = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Course Name]))
var _prevCourse = CALCULATE(MAX('Table'[Course Name]),FILTER(ALL('Table'),'Table'[Course Name]< SELECTEDVALUE('Table'[Course Name])))
var _prevCourseCount = CALCULATE(COUNTROWS('Table'),ALL('Table'),'Table'[Course Name]=_prevCourse)
return
IF(_prevCourseCount=0,BLANK(),DIVIDE(_curCourseCount,_prevCourseCount)-1)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank @az38 
You are the real MVP.
You help me again.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors