Forum Discussion

sieff1's avatar
sieff1
New Member
2 years ago
Solved

Return a Value based on last Step(Column) Updated

I have 9 Steps each their own column with a date, I am trying to count each value in the column based on what step it is at. So I am trying to have it where if the last date inputted in the row is on step 8 it returns an 8 in a return column, or if its step 3 it returns a 3 in that column. I have tried doing SWITCH(TRUE([Step 9] >9, 9, [Step 8] = 8, 😎 But it only returns the single value in all the rows. Is there any way to do this with DAX or power query or even measures? 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi sieff1 

     

    The Power bi isn't designed for calculations across rows.
    Maybe you can try to use the Unpivote Columns in power query to transform row into columns:

    Here I create a set of sample:

    Click the Transform data in the home pane.

    Then select all the columns and click the Unpivote Columns in transform pane:

    The result is as follow:

    That could be easier to get your outcome.

     

    If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

     

    Best Regards

    Zhengdong Xu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Wilson_'s avatar
    Wilson_
    Memorable Member

    Hi sieff1,

     

    Can you please share some actual data or a concrete example of what you're looking at?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sieff1 

     

    The Power bi isn't designed for calculations across rows.
    Maybe you can try to use the Unpivote Columns in power query to transform row into columns:

    Here I create a set of sample:

    Click the Transform data in the home pane.

    Then select all the columns and click the Unpivote Columns in transform pane:

    The result is as follow:

    That could be easier to get your outcome.

     

    If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

     

    Best Regards

    Zhengdong Xu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.