Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Souvik0812
Frequent Visitor

Values in multiple columns of one table to reference and sort themselves by a column in another tabl

I have a Project table which looks like this:

Project id  Overall RAG  Fin RAG  Bud RAG  Sch RAG
Project-1RedRedGreenAmber
Project-2GreyAmberGreyRed
Project-3GreyRedRedAmber
Project-4RedRedGreyRed
Project-5GreyAmberGreenGrey
Project-6AmberRedGreyGreen
Project-7RedGreenGreenRed
Project-8RedGreyGreenAmber
Project-9GreenRedAmberGreen
Project-10RedGreenRedRed

 

I need these RAG columns to be sorted (individually, whenever whichever is used/sorted) by referencing the sort values from the table below:

RAGSort Order
Red1
Amber2
Green3
Grey4

 

I mean when I am using any of the RAG columns it should get sorted referening this Sort Order table. I can create multiple sort order table for each RAGs, or I can create sort order columns for each RAG in the same Project table. But that would create redundant data and hence I am trying to keep only 1 Sort order table and reference all RAGs to sort using this table.

Is it possible? Apologies if I couldn't express my issue clearly, please let me know if further info/clarification needed.

Thanks in advance 🙂

4 REPLIES 4
JFarq
Helper I
Helper I

Did you find a solution for this?

I have a similar issue.

I'm trying to sort the survey questions responses in matrices in a specific order (Strongly Agree, Agree, Neither agree nor disagree, disagree, strongly disagree) using a single table as a reference for multiple questions/fields:

JFarq_0-1690888415592.pngJFarq_1-1690888472431.png

JFarq_3-1690888625472.png

I've tried using the following measure Activity is meaningful sort by 2 (based on this question solution)

 

Activity is meaningful sort by 2 = 
CALCULATE (
    SELECTEDVALUE ( LikertResponseOrderConnect[Name Order Index] ),
    CALCULATETABLE(
        MasterWithValidEntries2,
        USERELATIONSHIP ( MasterWithValidEntries2[Activity is meaningful], LikertResponseOrderConnect[Likert Question Response] ),
        ALLEXCEPT(LikertResponseOrderConnect, LikertResponseOrderConnect[Likert Question Response])
    )
)

 


It creates the new column with associated reference numbers:

NewColumn2.png


But I get a circular dependency error message when I try to sort my Activity is meaningful survey question responses field by this new column.

JFarq_4-1690889031819.png

 

Is there a way of doing this without having to create a separate table for each survey question response field?

Thanks for reading.

krishb1414
Helper III
Helper III

Hi @Souvik0812  If you have same values in all the columns then why don't you use UNPIVOT. So that you can able to get all the colors in one column then create calculated column like 
    Red = 1

    Amber = 2

    Green = 3

    Grey = 4

 

Finally sort your  RAG column with this calculated column.

 

If you have any doubts feel free to ask me.

 

Regards,
Krish

 

Hi @krishb1414 , thanks for your reply.

If I UNPIVOT the RAG columns it will create multiple rows for each project, the table will increase hugely in size as there are several columns other than the Project Id and RAG columns. Also, the Project ID won't serve as a Primary Key in the table anymore. There are many other RAGs as well, I only created an example with some of them.

Project Id        Attribute                     Value
Project-1Overall RAGGrey
Project-1SchedRAGGrey
Project-1ScopeRAGGrey
Project-1FinRAGGrey
Project-1BenRAGGrey
Project-1ResouRAGGrey
Project-1RiskOGrey
Project-1StakeRAGGrey
Project-2Overall RAGAmber
Project-2SchedRAGAmber
Project-2ScopeRAGGreen
Project-2FinRAGGreen
Project-2BenRAGGreen
Project-2ResouRAGGreen
Project-2RiskOGreen
Project-2StakeRAGAmber
Project-3Overall RAGGreen
Project-3SchedRAGGreen
Project-3ScopeRAGGreen
Project-3FinRAGGreen
Project-3BenRAGGreen
Project-3ResouRAGGreen
Project-3RiskOGreen
Project-3StakeRAGGreen

Hi @Souvik0812  You can create dimnesion table by using Project id and create relationship.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.