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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

How to chose axis for the graph

Capture6.PNG

Hello everyone! 

I have this data and I would like to see the distibution of the measure. To see in % how much of measure falls into range 0-10, how many 10-20. I was trying to show this on the bar graph but I dont know how to buid proper axis. I will be very thankful for help. 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous ,

Can you share sample data and sample output in table format?

 

refer this

https://www.youtube.com/watch?v=9kp2Nu_LuXg

https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-count-of-bins

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created some sample data to reproduce your scenario. The pbix file is attached in the end.

 

I assume that the measure is as below.

Measure = 
SWITCH(
    SELECTEDVALUE('Table'[Vesse|Scheduled]),
    67,0,
    445,2,
    469,1,
    578,36,
    1159,8,
    1160,16,
    1161,13,
    1162,15,
    1163,15,
    1164,19,
    1165,12,
    1166,21,
    1167,20,
    1168,21,
    1169,11,
    1170,12,
    1171,19,
    1172,15,
    1173,16,
    1174,14,
    1175,0,
    1176,17,
    1177,3,
    1178,10,
    1179,10,
    1180,8,
    1181,13,
    BLANK()
)

 

Table:

b1.png

 

Test:

b2.png

 

You may create a new measure as below.

Count = 
var _start = SELECTEDVALUE(Test[Start])
var _end = SELECTEDVALUE(Test[End])
var tab = 
SUMMARIZE(
    'Table',
    'Table'[Vesse|Scheduled],
    "Value",
    [Measure]
)
var newtab = 
SUMMARIZE(
    Test,
    Test[Range],
    Test[Start],
    Test[End],
    "Count",
    var s = [Start]
    var e = [End]
    var t = 
    ADDCOLUMNS(
        tab,
        "Flag",
        IF(
            [Value]>=s&&[Value]<e,
            1,0
        )
    )
    return
    COUNTROWS(
        FILTER(
            t,
            [Flag] = 1
        )
    )
)
return
SUMX(
    newtab,
    [Count]
)

 

Result::

b3.png

 

Best Regards

Allan

 

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
Ashish_Mathur
Super User
Super User

Hi,

This should be doable.  Share the link from where i can download the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created some sample data to reproduce your scenario. The pbix file is attached in the end.

 

I assume that the measure is as below.

Measure = 
SWITCH(
    SELECTEDVALUE('Table'[Vesse|Scheduled]),
    67,0,
    445,2,
    469,1,
    578,36,
    1159,8,
    1160,16,
    1161,13,
    1162,15,
    1163,15,
    1164,19,
    1165,12,
    1166,21,
    1167,20,
    1168,21,
    1169,11,
    1170,12,
    1171,19,
    1172,15,
    1173,16,
    1174,14,
    1175,0,
    1176,17,
    1177,3,
    1178,10,
    1179,10,
    1180,8,
    1181,13,
    BLANK()
)

 

Table:

b1.png

 

Test:

b2.png

 

You may create a new measure as below.

Count = 
var _start = SELECTEDVALUE(Test[Start])
var _end = SELECTEDVALUE(Test[End])
var tab = 
SUMMARIZE(
    'Table',
    'Table'[Vesse|Scheduled],
    "Value",
    [Measure]
)
var newtab = 
SUMMARIZE(
    Test,
    Test[Range],
    Test[Start],
    Test[End],
    "Count",
    var s = [Start]
    var e = [End]
    var t = 
    ADDCOLUMNS(
        tab,
        "Flag",
        IF(
            [Value]>=s&&[Value]<e,
            1,0
        )
    )
    return
    COUNTROWS(
        FILTER(
            t,
            [Flag] = 1
        )
    )
)
return
SUMX(
    newtab,
    [Count]
)

 

Result::

b3.png

 

Best Regards

Allan

 

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

 

amitchandak
Super User
Super User

@Anonymous ,

Can you share sample data and sample output in table format?

 

refer this

https://www.youtube.com/watch?v=9kp2Nu_LuXg

https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-count-of-bins

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Thank you for your answer. Those solutions would work for calculated column but this is measure and I dont have an option to group it. 

 

How I should share sample data ? It seems that I can attache here only videos and photos... 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors