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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BTA999
Frequent Visitor

bars in visual not appearing properly

Hi,

I am almost embarassed to ask this as I am sure it's a newbie question but I can't figure it out and I couldn't find a previous answer.

 

I am trying to put the change of market share (MS) of our sister companies between 2018 and 2020 into a nice visual.

I have created the query, got the measures working (with the tremendous help of johnt75 - thx again!) and when I put them on the X axis, they look like this:

SCR001.png

Not bad but I want to put the names of the companies on the Y axis (rather than having them on the legend) and have a nice, solid bar against every company name.

So I take the Partners field from the same query and put it into the Y axis.

Then I get this:

SCR002.png

This is definitely not 1 solid bar to each company and it doesn't even make sense at all.

I tried to tweak it, played around with the settings available but no success.

 

Could someone please point me to the right direction?

Thx a million!

 

 

 

1 ACCEPTED SOLUTION

Hi @BTA999 ,

 

Please try this measure to see if it matches the desired output.

 

2020-18 REF = 
DIVIDE (
    SUM ( 'Total Sales 2018-21'[Sales 2020] ),
    SUMX (
        ALLSELECTED ( 'Total Sales 2018-21' ),
        'Total Sales 2018-21'[Sales 2020]
    )
)
    - DIVIDE (
        SUM ( 'Total Sales 2018-21'[Sales 2018] ),
        SUMX (
            ALLSELECTED ( 'Total Sales 2018-21' ),
            'Total Sales 2018-21'[Sales 2018]
        )
    )

vkkfmsft_0-1657095813201.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @BTA999 ,

 

Are your ERX, ORX, and PECS... all measures? How did you calculate them? Why do you need to create separate measure for each company? If you can use only one measure to calculate, then you will get the chart shown below.

 

vkkfmsft_0-1656927742036.png

 

Best Regards,
Winniz

 

Hi Winniz @v-kkf-msft ,

Thank you for your kind reply!

Yes, there is a separate measure for every sister company (ERX, ORX and the rest).

 

This is the formula:

 

MS DEX 2020-18 REF = DIVIDE(
CALCULATE(
    SUM('Total Sales 2018-21'[Sales 2020]),'Total Sales 2018-21'[Partner]="DEX"), 
SUM('Total Sales 2018-21'[Sales 2020])) - 
DIVIDE(
    CALCULATE(
    SUM('Total Sales 2018-21'[Sales 2018]),'Total Sales 2018-21'[Partner]="DEX"), 
SUM('Total Sales 2018-21'[Sales 2018]))

 

Where "DEX" is the given company, 'Total Sales 2018-21' is the name of the query. All the other companies use the same formula, only the company names change.

 

I am using separate measures for every company because that was the only way I could think of to calculate the MS of the companies - but, of course, I am quite a newbie to PBI.

The image you included show exactly what I want, I am saluting you!

Could you please share the formula you used to get it?

 

Thank you again for your kindness and have a great day!

Attila

Hi @BTA999 ,

 

Please try this measure to see if it matches the desired output.

 

2020-18 REF = 
DIVIDE (
    SUM ( 'Total Sales 2018-21'[Sales 2020] ),
    SUMX (
        ALLSELECTED ( 'Total Sales 2018-21' ),
        'Total Sales 2018-21'[Sales 2020]
    )
)
    - DIVIDE (
        SUM ( 'Total Sales 2018-21'[Sales 2018] ),
        SUMX (
            ALLSELECTED ( 'Total Sales 2018-21' ),
            'Total Sales 2018-21'[Sales 2018]
        )
    )

vkkfmsft_0-1657095813201.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-kkf-msft ,

This is the correct formula!

I can't tell you how glad I am!

Thx a million for your kindness and for the opportunity for me to learn something new!

The ALL functions have been on my study agenda, just didn't get to them yet. But now I am going to delve into them.
Thx for your great help and have a great day!

Attila

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.