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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
neetu14
Employee
Employee

% of users : today vs yesterday

I am trying to calculate the percentage change in the number of users today compared to yesterday for the number of users column to see the growth.

 

can someone help with the Dax measure for calculating the percentage?

1 ACCEPTED SOLUTION

Hi @neetu14 ,

 

Check this measure

Measure = 
var today = CALCULATE(SUM('Table'[NumberOfUsers]),FILTER('Table','Table'[SnapshotDate]=TODAY()))
var yesterday = CALCULATE(SUM('Table'[NumberOfUsers]),FILTER('Table','Table'[SnapshotDate]=TODAY()-1))
return
(today-yesterday)/yesterday

Here's the result. Let me know if it works.

1.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

@neetu14 

it depends on your data model

in the most common case it will look like

Measure = 
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[UserID]), Table[Date] = TODAY()),
CALCULATE(DISTINCTCOUNT(Table[UserID]), Table[Date] = TODAY()-1)
)

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

I tried to use your formula

Percentage_Usage - DIVIDE(
CALCULATE(COUNT(Table[NumberOfUsers]), Table[SnapshotDate] - TODAY()),
CALCULATE(COUNT(Table[NumberOfUsers]), Table[SnapshotDate] ? TODAY()-1)
)
it is not giving any value 😞

I tried using your formula

Percentage_Usage = DIVIDE(
CALCULATE(COUNT(Table[NumberOfUsers]), Table[SnapshotDate] = TODAY()),
CALCULATE(COUNT(Table[NumberOfUsers]), Table[SnapshotDate] = TODAY()-1)
)
 
it is not giving any values 😞

Hi @neetu14 ,

 

Check this measure

Measure = 
var today = CALCULATE(SUM('Table'[NumberOfUsers]),FILTER('Table','Table'[SnapshotDate]=TODAY()))
var yesterday = CALCULATE(SUM('Table'[NumberOfUsers]),FILTER('Table','Table'[SnapshotDate]=TODAY()-1))
return
(today-yesterday)/yesterday

Here's the result. Let me know if it works.

1.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.