Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Group records by 1 Column, Filter by Another

    Bronze Contributor
    Posted Jan 10, 2022 02:53 PM
      |   view attached
    Hi

    See attached. I need to create a measure that, for each child occurrence, looks at the record with the highest RecordID and checks whether the HistoryCode equals 5; if it does then it's added to the total. I've included the parent ID as that's the grain in the matrix so not sure if that affects the approach so e.g. parent 1 would have a count of 2.

    Any help would be greatly appreciated!

    ​​

    ------------------------------
    Rob Littler
    BI Developer
    Warwick
    ------------------------------

    Attachment(s)

    csv
    data.csv   854 B 1 version


  • 2.  RE: Group records by 1 Column, Filter by Another

    Posted Jan 10, 2022 05:40 PM
      |   view attached

    Hi Rob,


    I hope the attached answers your question. I have had to add 2 more columns to your dataset to make this easier.

    I used max column and historycode on the filter pane for flexibility.

    Please do let me know if you need more assistance on this.Feel free to check out my LinkedIn and my website for further queries.

    Regards,
    Sam

    ------------------------------
    G Bolade
    RG2 0FZ
    ------------------------------

    Attachment(s)

    pbix
    data (1).pbix   28 KB 1 version


  • 3.  RE: Group records by 1 Column, Filter by Another

    Bronze Contributor
    Posted Jan 10, 2022 06:01 PM
    Hi Sam

    Thank you for coming back to me, really appreciate it. Unfortunately as stated in my post I think this needs to be a measure as there are other elements in play that are unknown at the time the calculated columns get updated. I was hoping once I had some working DAX I could figure out how to add the rest. How difficult do you think it would be to package up what you've done as a measure that returns a count?

    Thanks again

    Rob

    ------------------------------
    Rob Littler
    BI Developer
    Warwick
    ------------------------------