Forum Discussion

aliasghar's avatar
aliasghar
Regular Visitor
8 years ago

Parking utilisation

Hi all,

 

So I am a newbie to DAX and I would like to find out the number of cars that are inside the parking lot at an hourly rate based on user-type(daily & season). The sample data is below:

 

  

 

 Your help wiil be highly appreciated.

4 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi aliasghar,

     

    COUNT and COUNTROWS functions may help you.

     

    In addition, here is a similar thread you could have a reference.

     

    If you still need help, please share your data sample as table and your expected output.

     

    Best Regards,

    Cherry

    • aliasghar's avatar
      aliasghar
      Regular Visitor

      Hi v-piga-msft,

       

      Thanks for the respond, However, the COUNTIF function doesn't give me the expected output. Basically what I'm trying to achieve is to find out the number of people utilizing the parking space based on user type (daily & season) at an hourly rate.  The sample data as below:

       

      UserIdDateTimeTerminalExit/EntryChargesUser_Type
      FD0224506/3/201808:28:000DEntry3.71Daily
      FD0224506/3/201815:41:000CExit3.71Daily
      FD0224507/3/2018 08:39:310DEntry3.71Daily
      FD0224507/3/2018 12:30:420CExit4.77Daily
      FD0224508/3/2018 08:57:310DEntry2.65Daily
      FD0224508/3/2018 10:35:000CExit2.65Daily
      FD0224508/3/2018 10:57:270DEntry2.12Daily
      FD0224508/3/2018 17:00:170CExit2.12Daily
      FD0307158/3/2018 07:57:070DEntry3.71Daily
      FD0307158/3/2018 10:27:390CExit3.71Daily
      FD03484825/3/2018 11:23:370DEntry2.65Daily
      FD03484825/3/2018 12:54:440CExit2.65Daily
      FD0318813/3/2018 12:50:050DEntrySeasonSeason
      FD0318813/3/201814:20:000CExitSeasonSeason
      FD03469027/3/2018 11:36:030DEntrySeasonSeason
      FD03469027/3/2018 15:30:220CExitSeasonSeason
      FD03513313/3/2018 08:39:080DEntrySeasonSeason
      FD03513313/3/2018 11:47:030CExitSeasonSeason
      FD03675113/3/2018 08:42:190DEntrySeasonSeason
      FD03675113/3/2018 14:11:050CExitSeasonSeason
      FD03675114/3/2018 10:33:300DEntrySeasonSeason
      FD03675114/3/2018 12:33:410CExitSeasonSeason
      FD03675115/3/2018 12:45:050DEntrySeasonSeason
      FD03675115/3/2018 17:20:330CExitSeasonSeason
      FD03675116/3/2018 10:38:130DEntrySeasonSeason
      FD03675116/3/2018 12:38:590CExitSeasonSeason
      FD03675119/3/2018 13:22:210DEntrySeasonSeason
      FD03675119/3/2018 17:58:560CExitSeasonSeason
      FD03811214/3/2018 15:20:580DEntrySeasonSeason
      FD03811214/3/2018 18:02:080CExitSeasonSeason
      FD03811216/3/2018 10:18:510DEntrySeasonSeason
      FD03811216/3/2018 12:49:520CExitSeasonSeason
      FD03811216/3/2018 14:07:430DEntrySeasonSeason
      FD03811216/3/2018 17:00:400CExitSeasonSeason
      FD03811219/3/2018 13:39:110DEntrySeasonSeason
      FD03811219/3/2018 20:36:580CExitSeasonSeason

       

      Desired output:

       

      For everydayNo. DailyNo. SeasonTotal
      9 AM14923
      11 AM13821
      12 PM231235
      1 PM111223
      2 PM101222
      3 PM5813
      4 PM8917
      5 PM9413

       

      Or the desired output could also be in a form of a chart.

       

      Best Regards,

      Aliasghar.

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi aliasghar,

         

        Thanks for your data sample and your desired output.

         

        However, I'm not clear about the logic of your expected output, could you describe it in more details?

         

        Do you have another time table? For your expected output, it seems that we need to create a calculated table.

         

        Best Regards,

        Cherry