Forum Discussion

beginner's avatar
beginner
Helper I
3 years ago
Solved

How to populate missing location

My dataset is count incident days based on location for each month. I have other table where I keep locations(with different abbreviations). Some of the locations don't have any incidents and it does...
  • BA_Pete's avatar
    BA_Pete
    3 years ago

    Hi beginner ,

     

    You should first select the [Location] column in your Incidents table in Power Query and go to the Transform tab > Unpivot Columns (dropdown) > Unpivot Other Columns. This is the 'correct' structure for any data to be used in Power BI:

     

    To save model space and optimise performance, you should also filter out any zero values, so you have this:

     

    Once applied to the data model, write two measures, like this:

     

    _noofIncidents = SUM(IncidentsTable[Value])
    
    _noofIncidents0 = SUM(IncidentsTable[Value]) + 0

     

     

    Now, if you want to visualise only where incidents have happened, you can use LocationTable[Location] and [_noofIncidents] in your visual.

    If you want to visualise all locations, you can use LocationTable[Location] and [_noofIncidents0] in your visual.

     

    Pete