Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

100%

country allcountry only austria

 

 

Hi guys, 

 

as you can see in the first picture, i see 100% with Country All. 

Now, i want to see only austria and austria is 329.363 from 12.464917 units, 2.64% of 100%

But i want to see Austria = 100%

Is there a clever Dax formula for this matter? 

if there is Austria = 100 it will be also for Volvo: 4.443 of 329.363 = 1,3% Market share

 

Maybe you can help me 🙂 

 

3 Replies

  • Rabi's avatar
    Rabi
    Resolver I

    Mate provide some sample data or your PBI file, cant do anything without sample data

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    In response to your question, I did some preliminary research on it.

    You can make a measure at first to calculate the ratio of each value relative to the total for Austria.

    RatioToSubcategory = 
        SUM(Table[Value]) / CALCULATE(
            SUM(Table[Value]),
            ALL(Table),
            Table[Country] = "Austria"
        )
    

    To ensure that Austria shows as 100%, you can modify the formula as follows:

    AdjustedRatioToSubcategory = 
        IF(ISFILTERED(Table[Country]) && Table[Country] = "Austria",
            1,
            [RatioToSubcategory]
        )
    

    Similarly, you can create a measure for Volvo’s market share:

    VolvoMarketShare = 
        SUM(Table[VolvoValue]) / CALCULATE(
            SUM(Table[Value]),
            ALL(Table),
            Table[Country] = "Austria"
        )
    

    But if you provide me with specific data and pbix files, I can do more in-depth research to help you solve the problem.

    How to Get Your Question Answered Quickly 

     

     

    Best Regards

    Yilong Zhou

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

  • talespin's avatar
    talespin
    Solution Sage

    hi Anonymous ,

     

    Please replace table and column names with yours.

    Measure

    PctOfTotal =
    VAR _TotSales = CALCULATE(SUM(TestTbl1[Sales]), ALLSELECTED(TestTbl1[Country]), ALLSELECTED(TestTbl1[Region]))
    VAR _CountryRegionSales = CALCULATE(SUM(TestTbl1[Sales]))

    RETURN DIVIDE(_CountryRegionSales, _TotSales, BLANK())