Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Column Chart - various questions

  Hi I'm trying to create a visual (Stacked Column chart) to show the data for all the periods up to now and the current period (separate visual) Data is as follows:   Block | Date | Occupancy A...
  • v-joesh-msft's avatar
    6 years ago

    Hi Anonymous ,

    You can try the following methods:

    1. It does not display individual dates on the X-axis and has blank gaps:

    In the Format, change the X-axis type to Categorical, the solution in the Current Block is the same:

    2. How to automatically display the latest block:

    You can create a measure as follows:

    Measure =
    VAR _lastdateblock =
        CALCULATE (
            MAX ( 'Table'[Block] ),
            FILTER (
                ALLSELECTED ( 'Table'[Date] ),
                'Table'[Date]
                    = CALCULATE (
                        MAX ( 'Table'[Date] ),
                        FILTER ( ALL ( 'Table' ), 'Table'[Occupancy] <> BLANK () )
                    )
            )
        )
    RETURN
        CALCULATE (
            SUM ( 'Table'[Occupancy] ),
            FILTER ( 'Table', 'Table'[Block] = _lastdateblock )
        )

    When you create a visual, the results are as follows:

    Here is a demo, please try it:

    https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ee9YPKNrTaNIinDgPL9epukBIxgUaEuvAIFD1qxX2ZqMhQ?e=CfxnAv

     

    Best Regards,

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