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
GWoodhouse
New Member

Calculate Rank movement across time periods

I have a data set that shows ranking by website domain over time like this

GWoodhouse_2-1713261350178.png

 

I would like to create a measure that calculates the ranking movement by period like this

GWoodhouse_3-1713261365030.png

 

 

Any help with the dax is appreciated.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @GWoodhouse ,

 

Here are the steps you can follow:

1. Select the columns for all dates – Transform – Unpiovt Columns.

vyangliumsft_0-1713318685381.png

2. Select [Attribute] – Change Type – Date/Time

vyangliumsft_1-1713318685382.png

3. Create measure.

*/- =
var _date=
MAXX(
    FILTER(ALL('Table'),
    'Table'[Domain]=MAX('Table'[Domain])&&'Table'[Attribute]<MAX('Table'[Attribute])),[Attribute])
var _value=
SUMX(
    FILTER(ALL('Table'),
    'Table'[Domain]=MAX('Table'[Domain])&&'Table'[Attribute]=_date),[Value])
return
IF(
    _date=BLANK(),
    0,
_value - MAX('Table'[Value]))

4. Result:

 

vyangliumsft_2-1713318729651.png

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @GWoodhouse ,

 

Here are the steps you can follow:

1. Select the columns for all dates – Transform – Unpiovt Columns.

vyangliumsft_0-1713318685381.png

2. Select [Attribute] – Change Type – Date/Time

vyangliumsft_1-1713318685382.png

3. Create measure.

*/- =
var _date=
MAXX(
    FILTER(ALL('Table'),
    'Table'[Domain]=MAX('Table'[Domain])&&'Table'[Attribute]<MAX('Table'[Attribute])),[Attribute])
var _value=
SUMX(
    FILTER(ALL('Table'),
    'Table'[Domain]=MAX('Table'[Domain])&&'Table'[Attribute]=_date),[Value])
return
IF(
    _date=BLANK(),
    0,
_value - MAX('Table'[Value]))

4. Result:

 

vyangliumsft_2-1713318729651.png

Best Regards,

Liu Yang

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.