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
michielkuiper
Regular Visitor

Index bases in first period

I would like compare local sales with nation wide sales, especially i would like to compare the growth and/or shrink.

But our local sales is about thousants and the nation wide sales is about millions. 

To compare the sales I woukld like to index the values.

 

For example:

periodeSalesSales_overallIndex_SalesIndex_Sales_overal
2019262000500000100100
2019272002500122100,1100,0244
2019282003500562100,15100,1124
2019292004500879100,2100,1758
2019302008500215100,4100,043
2019312007500300100,35100,06
2019322009500600100,45100,12
2019332005500892100,25100,1784
2019342001501023100,05100,2046
2019352003500999100,15100,1998
2019362005500700100,25100,14
2019372010500190100,5100,038
2019382012500333100,6100,0666
2019392015501202100,75100,2404
2019402021502358101,05100,4716
2019412021502463101,05100,4926
2019422019502589100,95100,5178

 

michielkuiper_0-1624353433315.png

 

So, in Power Bi I only have the columns Period, Sales and Sales_overall.

I have to add columns Index_sales and Index_Sales Overal.

 

First i have add a new periodtable without any relations to other tables.

I made a slicer to select the index_period, for example i select period (week) 2019-26

Index_PeriodeID = MAX(Periode_Index[PeriodeID])

 

No i will sum each week the sales of that week with the sales of the index_PeriodeID

 

I tried several things and red several forums and websites but whitout any succes. 

An simular case can be found here, unfortunately I can't get it yet:

Solved: Re: Calculate index base 100 - Microsoft Power BI Community

 

I have got a table with:        Period, Sales, Sales_overall, Index_PeriodeID

 

So far so good, but it is not possible to settle the sales of that Period with the sales of Index_Period

 

Detail is that I have no real dates but dateID's (300052) or weeknumbers (201926 (yyyyww)).

 

I've done this before in Qlikview and it's not very complicated but I can't get it done in Power Bi.

i'll someone can help me en perhaps even other users! 

Thanks in advance. 

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

Hi, @michielkuiper 

 

According to your description, I create a sample file to reproduce your scenes.

You need to create a index column first, then create two custom column to show the results.

Like this:

 

index = RANKX('Table',[periode],,ASC)
Column 2 =
VAR presales =
    SUMX ( FILTER ( 'Table', [index] = 1 ), [Sales] )
RETURN
    DIVIDE ( [Sales], presales ) * 100
Column 3 =
VAR presales =
    SUMX ( FILTER ( 'Table', [index] = 1 ), [Sales_overall] )
RETURN
    DIVIDE ( [Sales_overall], presales ) * 100

 

vjaneygmsft_0-1624519746861.png

Best Regards

Janey Guo

 

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-janeyg-msft
Community Support
Community Support

Hi, @michielkuiper 

 

According to your description, I create a sample file to reproduce your scenes.

You need to create a index column first, then create two custom column to show the results.

Like this:

 

index = RANKX('Table',[periode],,ASC)
Column 2 =
VAR presales =
    SUMX ( FILTER ( 'Table', [index] = 1 ), [Sales] )
RETURN
    DIVIDE ( [Sales], presales ) * 100
Column 3 =
VAR presales =
    SUMX ( FILTER ( 'Table', [index] = 1 ), [Sales_overall] )
RETURN
    DIVIDE ( [Sales_overall], presales ) * 100

 

vjaneygmsft_0-1624519746861.png

Best Regards

Janey Guo

 

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

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.