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
errepinna
Helper I
Helper I

Grouping histogram bars

Hello everyone,

 

I'm trying to do something simple. I got different values of the same kind referring to the same entities, and I want to group them in an histogram together.

 

I made an excel file to visualize what I had in mind:

 

Schermata 2021-02-15 alle 17.18.49.png

 

Only in my case, sales A and sales B are two different tables and the value is not a column but rather a measurement I made with DAX. Is that possible?

1 ACCEPTED SOLUTION

Hi  @errepinna ,

 

Is below what you need?

v-kelly-msft_0-1613707217164.png

Check the updated .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@errepinna , Put both Location and type on Axis. Expand all levels. Sort on these two. And Switch off concatenate labels.

Concat Label Off.pngConcat2.png

My issue is that I have no "Type" column. Each type has a dedicated table so I can't put it on axis.

@errepinna ,Create a common location table. Have measure From both Tables and use them in clustered visual

https://www.youtube.com/watch?v=Bkf35Roman8

I've already made a common table for the "location". Yet if I try to put both measures on values, it just piles them up in a single bar.

Schermata 2021-02-15 alle 17.55.12.png

Hi  @errepinna ,

 

Can you provide a sample .pbix file for test?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Hi  @errepinna ,

 

Modify your measures as below:

%impactAoverTotA = 
//SUM('A type sale'[A value])/CALCULATE(SUM('A type sale'[A value]), REMOVEFILTERS('type'[Type]))
var _sumA=CALCULATE(SUM('A type sale'[A value]),FILTER(ALL('A type sale'),'A type sale'[Location Code]=MAX('location'[Location Code])&&'A type sale'[Type]=MAX('type'[Type])))
var _sumtotal=SUMX(ALL('A type sale'),'A type sale'[A value])
Return
DIVIDE(_sumA,_sumtotal)
%impactBoverTotB = 
//SUM('B type sale'[B Value])/CALCULATE(SUM('B type sale'[B Value]), REMOVEFILTERS('type'[Type]))
var _sumB=CALCULATE(SUM('B type sale'[B Value]),FILTER(ALL('B type sale'),'B type sale'[Location Code]=MAX('location'[Location Code])&&'B type sale'[Type]=MAX('type'[Type])))
var _sumtotal=SUMX(ALL('B type sale'),'B type sale'[B Value])
Return
DIVIDE(_sumB,_sumtotal)

Then turn off "Concatenate labels" under X axis:

v-kelly-msft_0-1613610893047.png

And you will see:

v-kelly-msft_1-1613610939607.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

Hello, thank you for your help!

However, this isn't what I'm trying to achieve. I'm already using an all-page filter to select a single "sale type" (RIC, DID, etc). 

 

On top of that, I'm trying to display the two columns not piled up but separated, so that I can visualize their different height.

 

So the information is, for example: I want to see, for each location, how much (in %) of total sale A was realized on type DID compared to all Sale A. So I put a filter on the view for type DID and calculate the the %impactonA by removing the DID filter from the denumerator.

I do the same with sale B.

I want to see them close together instead of piled up. I don't care about having the different types on the axis because each type gets his view.

 

I'm sorry if I wasn't clear about it before.

Hi  @errepinna ,

 

Is below what you need?

v-kelly-msft_0-1613707217164.png

Check the updated .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Worked out! Thanks!

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.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.