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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
OllyTron
Regular Visitor

Help with chart to show distribution

I have a list of names and values (value calculation shown in image). I want to create a chart that shows distribution of these values. The chart would have 1-40 along the bottom and a bar showing the total number of each '1ticket peryear'

So from the data below the value for 22 should = 7. As 22 shows 7 times in the dataset.

This feels like it should be easy but i can't get my brain to bring it together in PBI! TIA

 

OllyTron_0-1687203258324.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @OllyTron ,

I created some data:

vyangliumsft_0-1687315551206.png

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _table=
SUMMARIZE(
    ALL('Table'),'Table'[Index],'Table'[Year],'Table'[TickerCount],"Value",
    CALCULATE(
    SUM('Table'[TickerCount])/DISTINCTCOUNT('Date'[Year])))
VAR _ADDCOUNT =ADDCOLUMNS(
    _table,"count",COUNTX(FILTER(_table,[Value]=EARLIER([Value])),[Value]))
return
SUMX(FILTER(_ADDCOUNT,[Index]= MAX('Table'[Index])),[count])

2. Result:

vyangliumsft_1-1687315551208.png

 

Best Regards,

Liu Yang

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
Anonymous
Not applicable

Hi  @OllyTron ,

I created some data:

vyangliumsft_0-1687315551206.png

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _table=
SUMMARIZE(
    ALL('Table'),'Table'[Index],'Table'[Year],'Table'[TickerCount],"Value",
    CALCULATE(
    SUM('Table'[TickerCount])/DISTINCTCOUNT('Date'[Year])))
VAR _ADDCOUNT =ADDCOLUMNS(
    _table,"count",COUNTX(FILTER(_table,[Value]=EARLIER([Value])),[Value]))
return
SUMX(FILTER(_ADDCOUNT,[Index]= MAX('Table'[Index])),[count])

2. Result:

vyangliumsft_1-1687315551208.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors