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
Anonymous
Not applicable

Measure help

I am trying to create a graph that looks at how many users are in Top/Bottom/Middle tier based on a ranking system we have, but as these change on a daily basis i need to have a calculation that that looks at a specific user ID at gives me the most recent User tier by date. so i only want to see the latest tier based on the date i select. Below is some sample data, each user will appear multiple times with different user levels by date;

 

IDUsernameUser IDUser  LevelDate
11111Steve186964Top05 February 2020
22222John570676Bottom06 February 2020
3333Mary343110Middle07 February 2020
4444Claire1027573Top 25 February 2020
55555Chris55175Bottom18 February 2020
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create measure like DAX below.

 

Count User per tier =
VAR _MaxDate =
    CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[User  Level] ) )
RETURN
    CALCULATE (
        COUNT ( Table1[User ID] ),
        FILTER ( ALLEXCEPT ( Table1, Table1[User  Level] ), Table1[Date] = _MaxDate )
    )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

View solution in original post

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create measure like DAX below.

 

Count User per tier =
VAR _MaxDate =
    CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[User  Level] ) )
RETURN
    CALCULATE (
        COUNT ( Table1[User ID] ),
        FILTER ( ALLEXCEPT ( Table1, Table1[User  Level] ), Table1[Date] = _MaxDate )
    )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

amitchandak
Super User
Super User

@Anonymous , Try to create columns like

for use level  lastnonblankvalue(table[Date],max(table[User Level]))

use max date if needed

 

Anonymous
Not applicable

@amitchandak i need this to be a measure so when i move dates on a filter it will go to the latest base don that date hence why i cant use a calculated column

parry2k
Super User
Super User

@Anonymous if a user has two tiers on the same date, which Tier you will pick, let's say Chris has two-values - bottom and top on the same date (or it will never happen) then what Tier will be used?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k no you would only have 1 tier for 1 date 

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.