Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Clustered Column Chart Question

Hello,

I am trying replicate the following chart (or as close as I can in Power BI) and allow the periods to be user defined or require minimal effort to change the periods. Thanks in advance for any guidance on this request.

Here is an example of my raw data;

 

 

  • Hi, Anonymous 

    Try measure as below:

     

    Duration Greater than 30 Less than 2 Hours =
    CALCULATE (
        COUNTROWS ( 'eventsList Total' ),
        'eventsList Total'[Lane Blockage Duration] > 30
            && 'eventsList Total'[Lane Blockage Duration] <= 120
    )
    

     

     

    Best Regards,
    Community Support Team _ Eason

4 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    you can create a measure for each "bucket":

    Duration 30 Min or less =
    CALCULATE(
        COUNTROWS( myTable[Event ID] ),
        myTable[Lane Blockage Duration] <= 30
    )

     

    If you want to make that selection more dynamic add a what-if-slicer and instead of the number (30 in this case) use the SELECTEDVALUE from the what-if-slicer.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      I got this to work;

      Duration 30 Min or less =
      CALCULATE(
      COUNTROWS( 'eventsList Total' ),
      'eventsList Total'[Lane Blockage Duration] <= 30
      )

      But I ran into an issue for the Greater than 30 Less than 2 Hours measure. How do I set that up?

      • v-easonf-msft's avatar
        v-easonf-msft
        Community Support

        Hi, Anonymous 

        Try measure as below:

         

        Duration Greater than 30 Less than 2 Hours =
        CALCULATE (
            COUNTROWS ( 'eventsList Total' ),
            'eventsList Total'[Lane Blockage Duration] > 30
                && 'eventsList Total'[Lane Blockage Duration] <= 120
        )
        

         

         

        Best Regards,
        Community Support Team _ Eason