Forum Discussion

littlevillage's avatar
littlevillage
Iron Contributor
Jul 28, 2022
Solved

How can I combine formula in Data Model

Hi,

I am trying to combine data from Data Model into a Pivot Table , I have written some Measures but it hasn't shown the expect result.

I have added an image and the link of the Samplefile below

Hope for your help

Thank you

https://docs.google.com/spreadsheets/d/17vk5RKv2qUJIvD_5H-E0DRg_uO5xeoFw/edit?usp=sharing&ouid=112310544159929632856&rtpof=true&sd=true 

 

  • SergeiBaklan's avatar
    SergeiBaklan
    Jul 30, 2022

    littlevillage 

    If build relationships as

    your PivotTable gives practically desired result.

    The only it's better to use

    perc late A:=DIVIDE( [Total late], [Total ontime], BLANK() )

    instead of

    perc late:=[Total late]/[Total ontime]

    As third parameters in DIVIDE you may use whatever you want instead of BLANK().

    Another point we have blank for hub areas, that means not all areas appears in Table1 and Table2  are in Table3. But that's better to adjust Table3.

    Please check in attached file.

     

14 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    littlevillage 

    That could be done by Power Query as in attached file. I guess all your tables are generated from data model. If so perhaps it'll be easier to generate required result directly in model and return into the sheet as Table or PivotTable.

    • littlevillage's avatar
      littlevillage
      Iron Contributor

      SergeiBaklan 

      Thank for your assistance
      The Power Query shows correctly 100% the expect result.
      How can we do it the same by Power Pivot because I want to create a pivot table from Power Pivot, that I can see details what I need.
      Hope for your help

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        littlevillage 

        It depends on what do you have in data model. If you could share the file with it and PivotTables you generated in the sample I could try.

  • Willjoe2442's avatar
    Willjoe2442
    Brass Contributor
    Alternatively, to create a formula that uses a function, click the “Design” tab in the data model window's Ribbon. Then click the “Insert Function” button in the “Calculations” button group to open the “Insert Function” dialog box. Then select a function in the listing in this dialog box

    Hope this helps
    • littlevillage's avatar
      littlevillage
      Iron Contributor

      Harun24HR 

      you have given me a amazing formula to get correctly result. Actually, I want to create a pivot table from Power Pivot, that I can see details what I need.
      Thank you

    • littlevillage's avatar
      littlevillage
      Iron Contributor

      Riny_van_Eekelen

      Thank for your response

      Actually, I want to get expect result directly from data ( column A:E)

      I have created a pivot table from power pivot, but it returns the failed result

      I have added an image and the link of the samplefile below that shows the expect result

      Hope for your help

      https://docs.google.com/spreadsheets/d/1Q5_5Uurc44ldWcopN4fE1hNA_9gdIweB/edit?usp=sharing&ouid=112310544159929632856&rtpof=true&sd=true  

       

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    In you sample file "HUB are" 239F01 has 80 time in column B (Late Area). So, why your expected result is 72 for this 239F01 hub area?

Resources