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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JaouadZrhibi
Helper I
Helper I

Market share issue - Distribution over a single year

Hi,

 

I have tried different measures but I cant see the distribution over a single year.

 

My formula calculate the market share for all years from 2001 till 2018 but how to do it for only one year ?

 

one year for one direction (import or export) = 100% market share 

 


Market share issue_Distribution over 1 year.jpg

 

 

Market Share Import = DIVIDE(CALCULATE(SUM([Tons]));CALCULATE(SUM([Tons]);ALL('Details'); Table[Column] = "Import")) 

Market Share Export = DIVIDE(CALCULATE(SUM([Tons]));CALCULATE(SUM([Tons]);ALL('Details'); Table[Column] = "Export")) 

 

OR 

 

Market Share = DIVIDE ( CALCULATE ( SUM ( [Tons] ) ), CALCULATE ( SUM ( [Tons] ), VALUES ( Details[Direction] ), ALL ( Details ) ) )

 

 

PBIX file =  https://drive.google.com/open?id=1sRFKhMPu1LSjMtk58_Z7e_B1BTHhn5FS

 

Thank you for your help and support,

 

Jaouad

10 REPLIES 10
v-frfei-msft
Community Support
Community Support

Hi @JaouadZrhibi,

 

Please update the measure Market Share to this one.

 

 

Market Share = DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),ALLEXCEPT('Details',Period[Year]))) 

Capture.PNG

 

Also please find the pbix attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi Frank @v-frfei-msft  Hi Greg @Greg_Deckler

 

I thank you for your measure but I need to separate Import & Export markets.

 

I would like to get 100% market share if we select only IMPORT.

 

Also 100% market share if we select only EXPORT.

 

In fact, it isn't pertinent to "mix" import & export markets because they are different markets.

 

File is here

https://drive.google.com/open?id=1sRFKhMPu1LSjMtk58_Z7e_B1BTHhn5FS

 

Please see the pictures below. Hope they will help you.

 

One year and Import selected.png

 

One year and EXPORT selected.jpg

 

 

Thank you for your help !

 

Jaouad

 

 

 


@v-frfei-msft wrote:

Hi @JaouadZrhibi,

 

Please update the measure Market Share to this one.

 

 

Market Share = DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),ALLEXCEPT('Details',Period[Year]))) 

Capture.PNG

 

Also please find the pbix attached.

 

Regards,

Frank




Hi @JaouadZrhibi,

 

Please check the formula again.

 

Market Share = 
var maxyear = MAX(Period[Year])
var Direction = SELECTEDVALUE(Details[Direction])
return 
DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),FILTER(ALL(Details),Details[Year]=maxyear && Details[Direction]=Direction)))

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft

 

It looks good, I m going to do some test.

 

If we want to see the market share on 2 years / 3 years or 10 years, can we get 100% for each one ?

 

For example, 2 years = 2016 and 2017 = 100% market share

 

3 years = 2013 + 2014 + 2015 = 100% market share

 

10 years = from 2009 till 2017 = 100% market share

 

Do we have to change all formula ? If it is too difficult, it is not necessary. 

 

One year is really good.

 

I m sorry for disturbing you Frank.

 

Thank you very much for your help and time !!

 

Jaouad

 

 

 

 

 


@v-frfei-msft wrote:

Hi @JaouadZrhibi,

 

Please check the formula again.

 

Market Share = 
var maxyear = MAX(Period[Year])
var Direction = SELECTEDVALUE(Details[Direction])
return 
DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),FILTER(ALL(Details),Details[Year]=maxyear && Details[Direction]=Direction)))

 

Regards,

Frank


 

Hi @JaouadZrhibi,

 

Here we go.

 

Market Share2 = 
var minyear = MIN(Period[Year]) 
var maxyear = MAX(Period[Year])
var Direction = SELECTEDVALUE(Details[Direction])
return 
DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),FILTER(ALL(Details),Details[Year]<=maxyear&&Details[Year]>=minyear && Details[Direction]=Direction)))

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft

 

I would like to know if this formula below is good for the Market Share measure :

 

Market Share =
DIVIDE (
    CALCULATE ( SUM ( [Tons] ) );
    CALCULATE (
        SUM ( [Tons] );
        FILTER (
            ALL ( 'Details' );
            YEAR ( Details[Date] ) IN VALUES ( Period[Year] )
                && Details[Direction] IN VALUES ( Details[Direction] )
        )
    )
)

 

Hi @JaouadZrhibi,

 

Just use the new measure in the visual, now shuold be ok. Please find the pbix attached. Also your formula worked well. You can refer to the third page.

 

2.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

We need only one Market Share Measure for all widget on the same page, isn't it ?

We neen only one Market Share Measure for all widget on the same page, isn't it ?

I find figures above 100 % like on the pictures.

 

Is it normal ?

 

figures above 100%.jpg

 

Regards,

 

Jaouad

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.