Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Combine Results into single cell

    Posted Oct 25, 2022 11:23 AM
    Hi,
    I am trying to come up with a straightforward solution to map a course to the recommendation. This would be relatively straightforward EXCEPT sometimes the student will take TWO courses in the year. I want my data to look like this (with my problem field in bold):

    ID Recommended By Id Course Title Rec Year Department Current Course Current Course Year
    12345 5678 Accel Precalculus 2020 - 2021 US Mathematics & Computer Science Geometry 2019 - 2020
    12345 5678 Accel Algebra 2/Trig 2020 - 2021 US Mathematics & Computer Science Geometry 2019 - 2020
    12345 5678 Accel Precalculus 2021 - 2022 US Mathematics & Computer Science Accel Algebra 2/Trig, Microeconomics 2020 - 2021
    12345 5678 AP Calculus AB 2022 - 2023 US Mathematics & Computer Science Accel Precalculus 2021 - 2022 

    Pulling the current course data from:
    user_id Department Course Title school_year_label
    12345 MS Mathematics Pre-Algebra 2017 - 2018
    12345 MS Mathematics Algebra 1 2018 - 2019
    12345 US Mathematics & Computer Science Geometry 2019 - 2020
    12345 US Mathematics & Computer Science Accel Algebra 2/Trig 2020 - 2021
    12345 US Mathematics & Computer Science Microeconomics 2020 - 2021
    12345 US Mathematics & Computer Science Accel Precalculus 2021 - 2022
    12345 US Mathematics & Computer Science AP Calculus AB 2022 - 2023

    If everything were 1 to 1 this would be easy, but how can I get the two courses for the current course year 2020 - 2021 into a single cell with only a basic knowledge of scripting? Is there something baked into PowerBI that would help?



    ------------------------------
    Alexander Taft
    Program Manager
    Washington
    ------------------------------


  • 2.  RE: Combine Results into single cell

    Bronze Contributor
    Posted Oct 25, 2022 05:36 PM
    Seems like this could be solved with the DAX function CONCATENATEX. If you need help setting up the measure I would need to know more about how your data model is set up.

    ------------------------------
    Tomas
    ------------------------------