Forum Discussion

ROLFUS's avatar
ROLFUS
Regular Visitor
2 years ago
Solved

PowerBI

I have a data set with machine types, say A, B, C, D, and E. Then I have a data set for the service team where some can only service a specific machine type, but others can service multiple types based on their skill set.
Now, I want to display where the machines and technicians are on a map and create a table showing the machine type-to-technician ratio.
I can't get it to work since it has only one type in the machine data, but it could be A, B, or even more in the tech data.
Is there a way to do such an analysis?

  •  

    Ok, I think I understand what you're going for.

     

    See attached an example PBIX below. What I've basically done is:

     

    -1- Split out your A/B, C/E etc. Techs into new rows in Power Query.

    -2- Also in Power Query, created a new dimTech table, that just contains a unique list of all the Tech Codes (A, B, C etc).

    -3- Related the new dim table to both Machines and Technicians tables.

    -4- Created the following measures:

     

    _noofMachines = DISTINCTCOUNT(machine[Serial Number])
    
    _noofTechnicians = DISTINCTCOUNT(technician[NAME])
    
    _machineToTechRatio = DIVIDE([_noofMachines], [_noofTechnicians], 0)
    
    _techToMachineRatio = DIVIDE([_noofTechnicians], [_noofMachines], 0)

     

    -5- Using dimTech[techCode] in the visual, it gives the following output based on your example data provided:

     

    In terms of getting this working on a map visual, you'll need to create dimension tables for Country/City/Zip etc. and relate to both tables in the same way as dimTech. It might be cleaner if you just create a location code in each of the fact tables, then your dimLocation table can have [locationCode], [Country], [City] etc. to be plotted on the visual.

     

    Pete

7 Replies

  • Hi ROLFUS ,

     

    Please provide anonymised example data of both the Machine Types and Technicians tables, as well as examples of your expected outputs please.

     

    Pete

  • ROLFUS's avatar
    ROLFUS
    Regular Visitor

    Hi Pete,

    Serial NumberTECHCityStateZipCountry

    Machine001AWOODBRIDGEONL4L3T1CANADA
    Machine001AMUSKEGONMI49444USA
    Machine003BBEDFORDIN47421USA
    Machine004BWEST JEFFERSONNC28694USA
    Machine007CPULASKIVA24301USA
    Machine008CPORT HURONMI48060USA
    Machine008DMAPLE GROVEMN55369USA
    Machine008DBERKELEYMO63134USA
    Machine008EANKENYIA50021USA
    Machine008EGLASGOWKY42141USA

     

    NAMETECHCITYSTATE/PROVINCEZIP CODE/POSTAL CODECountry

    TECH001AGilbertAZ85297USA
    TECH018AKISSIMMEEFL34744USA
    TECH015A/BSt. CloudFL34769USA
    TECH023A/BWaukeganIL60087USA
    TECH008A/CSanta AnaCA92704USA
    TECH009A/CCypressCA90630USA
    TECH056A/CRussellvilleOH45168USA
    TECH057A/CNorth RoyaltonOH44133USA
    TECH062A/CDundalkONN0C 1B0CANADA
    TECH074BBaxterTN38544USA
    TECH081BGrahamWA98338USA
    TECH083BWheelingWA26003USA
    TECH050CConcordNC28027USA
    TECH076CHoustonTX77062USA
    TECH011DWillingtonCT06279USA
    TECH012DBristolCT06010USA
    TECH047DMorgantonNC28655USA
    TECH048DHuntersvilleNC28078USA
    TECH005D/BPerrisCA92571USA
    TECH030D/BPlymouthIN46563USA
    TECH082D/BPort OrchardWA98367USA
    TECH026EPalatineIL60074USA
    TECH027EHoffman EstatesIL60169USA
    TECH037A/ELake OrionMI48360USA
    TECH038A/ECambridgeMN55008USA
    TECH054ESpringboroOH45066USA

     

    Thats what im looking for. The data are not right because the data dont match

     

    Thank you.

    Rolf

    • BA_Pete's avatar
      BA_Pete
      Super User

      Hi Rolf,

       

      Can you give me examples of your expected outputs please?

      I need to know what the correct output looks like in order to work out how to produce it from your data.

       

      Pete

      • ROLFUS's avatar
        ROLFUS
        Regular Visitor

        Hello Pete,
        Below is the output I'm looking for, but the problem is that the technician count per machine is incorrect. The technician total in the left table is 79, but if you count the tech per the machine types, there are only 67 because the ones who can serve more than one type are not counted.
        What I'm looking for is that the technicians who can do multiple types are counted on the types they can support (at least to 50%).

        Here is a sample what I want to have. I hope that helps

        MA TypeMachinesTechnRatio MA/TECH
        A13315.58.58
        B25741.56.19
        C4313.53.19
        D123.53.43
        E2254.40
        Grand Total46779 

         

        Rolf