cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxW Regular Visitor
Regular Visitor

Dax challenge! Category based on trend

Hi,

 

Bit of a DAX challenge here (or suggest a better alternative).

I have a list of users and timestamps when they have logged in. I also have a calendar table. I want to split these users into four categories:

No usage

Steady Usage
Decreasing Usage

Increasing Usage

The split should be based on the trend of # of weekly logins in the last three months.  

Help much appreciated!

1 REPLY 1
Super User
Super User

Re: Dax challenge! Category based on trend

Hi @MaxW,

 

Not sure how you have the setup of your data and how you are calculating the 4 levels of usage but I have made this setup:

 

  • Table DimDate
  • Table TimeStamp (User + Login Date)
  • Table Users

 

  • Created two measure with the following formula:

 

 

Usage =
VAR Usage_user =
    COUNT ( TimeStamps[User] )
RETURN
    CALCULATE ( IF ( Usage_user = BLANK (); 0; Usage_user ) )



Usage text =
SWITCH (
    TRUE ();
    [Usage] = 0; "No Usage";
    [Usage] <= 3; "Decreasing Usage";
    [Usage] <= 5; "Steady Usage";
    "Increasing USage"
)

 

Then just add them to your visuals:

 

usage.png

 

My data only has information for the 3 month but if you need the formulas can be adjusted to get the 3 months as you need, just tell me how are you calculating the 3 month back is it from current date or selected from a slicer, also you need to define how you are considering the increasing decreasing values.

 

Regards,

MFelix

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 40 members 1,000 guests
Please welcome our newest community members: