cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dynamic Histogram with Measures

Hi everybody ! How are you?

 

I need to do a dynamic histogram where the value is a measure. It is a possible?

 

Basically, I need a histogram that is based on a measurement and that changes according to the selected date slicer changes.

The example would be as follows:
I have a measurement ranging from -100% to 100% and I need to group stores with values from -100% to 100% in 10% intervals.

 

Thanks !

Regards!

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

First of all, We can create a calculated table as the Axis:

 

X-Axis =
ADDCOLUMNS (
    ADDCOLUMNS ( GENERATESERIES ( -1, 0.9, 0.1 ), "Value2", [Value] + 0.1 ),
    "RangeName", FORMAT ( [Value], "Percent" ) & "  ~  "
        & FORMAT ( [Value2], "Percent" )
)

 

9.PNG

 

Then we can create a measure to count the value dynamicly

 

Count =
COUNTROWS (
    FILTER (
        'Table',
        [Measure] >= MIN ( 'X-Axis'[Value] )
            && [Measure] <= MAX ( 'X-Axis'[Value2] )
    )
)

 

10.PNG

 


If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


Best regards,

 

Community Support Team _ Dong Li
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

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

First of all, We can create a calculated table as the Axis:

 

X-Axis =
ADDCOLUMNS (
    ADDCOLUMNS ( GENERATESERIES ( -1, 0.9, 0.1 ), "Value2", [Value] + 0.1 ),
    "RangeName", FORMAT ( [Value], "Percent" ) & "  ~  "
        & FORMAT ( [Value2], "Percent" )
)

 

9.PNG

 

Then we can create a measure to count the value dynamicly

 

Count =
COUNTROWS (
    FILTER (
        'Table',
        [Measure] >= MIN ( 'X-Axis'[Value] )
            && [Measure] <= MAX ( 'X-Axis'[Value2] )
    )
)

 

10.PNG

 


If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


Best regards,

 

Community Support Team _ Dong Li
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

to avoid a value that lies on the edge of a category being counted in both the the lower and higher categories, I recommend changing the count measure from

 

Count =
COUNTROWS (
    FILTER (
        'Table',
        [Measure] >= MIN ( 'X-Axis'[Value] )
            && [Measure] <= MAX ( 'X-Axis'[Value2] )
    )
)

 

to

 

Count =
COUNTROWS(
    FILTER(
        'Table',
        [Measure]
            MIN( 'X-Axis'[Value] )
            && [Measure]
                <= MAX( 'X-Axis'[Value2] )
    )
)

 

 

Anonymous
Not applicable

@v-lid-msft  Excellent !! Works perfect !

Thanks !!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.