Forum Discussion

Dellis81's avatar
Dellis81
Icon for Post Prodigy rankPost Prodigy
4 years ago

Single dimension with multiple columns in fact table

Hello!

I am needing help (please) with measures that have relate to multiple columns within the fact table, but single column within a dimension table.  Very similar to fact table w/multiple dates utilizing a single calendar table.   In this case, using cost accounting type data - have a center dimension, but the fact table has multiple center connotations (Center ID, Source Center ID, & Operating Center ID)

 

File link: https://drive.google.com/file/d/15IGfeE2isgA4AIE5q8olLZi7dv542sEe/view?usp=sharing

 

The below screen shot is an illustration of both the Dimension table (Center) and Fact table (Center).  Note the fact table has 3 references back to the Center Dimension

I have three measures (utilizing the 'userelationship") dax function - and the below screenshot displays the correct result w/no external filters.   These are the correct totals.

 

 

 

 

However, when I introduce external slicers/filters - I get a bunch of empty results.   In practice, I will have a page filter for Center Type "CC:Resources", with single select toggle for Center Group.   My request is return correct results when external filters/slicers are introduced.    The correct results would be as presented in 2nd screenshot image

 

Thank you for assistance.   Yes, I have submitted same issue before, but I am hoping I have improved terminology and example  file.   Thank you!

4 Replies

  • Dellis81 the reason your measures are returning blank is that you have a filter in your measure itself, let's take an example of the following measure, it is filtered where Entry Type = "REsourceCDU1" and if you look at the raw data, when you select Center Type = CC:Resource, you don't have a record in the fact table where Entry Type = "ResourceCDU1" and that's why your measure doesn't return any value.

     

    Quantity = calculate(sum(Data[Quantity]),Data[EntryType]="ResourceCDU1")

     

    I hope it helps, at first look, it looks like a data issue, or maybe I missed something obvious, let me know.

     

    • Dellis81's avatar
      Dellis81
      Icon for Post Prodigy rankPost Prodigy

      parry2k 
      Yes, I see and understand what you are saying.   But, as usual - there is probably more to the story I failed to include.   For the data field "Entry Type" - there are numerous types that I use for other purposes.  For example - ResourceCDU1 is hours, ResourceCDU2 is acres, And then I have other CDU's for other center types (activities) that utilize the same "Quantity" data field.   So, I will need some kind of filter to get to my ResourceCDU1's.

      In my 'bigger' data model, the provided model design seems to be working for 95% of the use cases.  But if you have thoughts on how these cost driver records could be tweaked, I'm open for ideas.    I just like a single record - as then you can see all three centers in one place.


      I have attempted another measure excluding the ResourceCDU1 filter - with same result.   I was playing with DAX remove filters, and values functions with no success.

      Quantity (no CDU filter) = calculate(sum(Data[Quantity]),
          REMOVEFILTERS(Centers),VALUES(Centers[Center ID])

      If this helps (2nd and 3rd matrixes from initial explanation)


      Left matrix is the activity those resources (tractors, combines, etc)  were used in (within the same "GSF" entity (spraying, combining, planting, etc).

       

      Right matrix is the operating entity and center for both GSF and GFF entities.

       

      Please note the 18 hours tagged to Lease Center in left matrix matched the 18 hours represented under the GFF entity in right screenshot.  Those 18 hours are leased from the GSF to GFF entities, so I need differentiating center ID's data fields?

      Thank you for your help!!!!


       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Dellis81 ,

        In order to provide you with a suitable solution, could you please give some simple examples of the results you want based on the available data in your sample pbix ifle? This needs to include the backend logic, calculation rules, screenshots of the results, etc. Thank you.

        Best Regards