Forum Discussion

IshaDahra's avatar
IshaDahra
Regular Visitor
4 months ago
Solved

Serial No. in visualisation

Hi,
I have inserted a table in visualization in which columns are taken from different tables. I want a column in which serial no. comes

  • Hi IshaDahra,

     

    Use below DAX

     

    S.No =
    RANKX(
    SUMMARIZE(
    ALLSELECTED('FACT_STORY'),
    'FACT_STORY'[Number],
    "MinUpdated", MIN('FACT_STORY'[Updated])
    ),
    [MinUpdated],
    ,
    ASC,
    DENSE
    )

10 Replies

  • Hi IshaDahra,

     

    You can use below DAX

     

    Serial No =
    RANKX(
    ALLSELECTED(
    'Table1'[Column1],
    'Table2'[Column2],
    'Table3'[Column3]
    ),
    CALCULATE(1),
    ,
    ASC,
    DENSE
    )

     

    If you have one key column in table you can use it like below

     

    Serial No =
    RANKX(
    ALLSELECTED(FactTable[UniqueID]),
    MAX(FactTable[UniqueID]),
    ,
    ASC
    )

     

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together!

    • IshaDahra's avatar
      IshaDahra
      Regular Visitor

      Hi,
      The first dax is giving error:
      All column arguments of the ALL/ALLNOBLANKROW/ALLSELECTED/REMOVEFILTERS function must be from the same table.

      And, second is giving only 1

      • grazitti_sapna's avatar
        grazitti_sapna
        Super User

        Hi IshaDahra,

         

        Got the issue, All selected can only use single table and 1 is due to the MAX function.

         

        Try below DAX 

         

        Serial No =
        RANKX(
        SUMMARIZE(
        ALLSELECTED('FactTable'),
        'FactTable'[WorkerID],
        'FactTable'[Date]
        ),
        CALCULATE(MIN('FactTable'[Date])),
        ,
        ASC,
        DENSE
        )

  • Hi IshaDahra 

     

    You can create visual calculation(Select Your Visual->Home->New Visual Calculation) like below in your visual:

    Order by can be changed based on your requirement.

    RowNumber = FORMAT(
        ROWNUMBER(
        ROWS,
        ORDERBY([reporting year],ASC)
        )
        ,"0"
    )
    

    Please give kudos or mark it as solution once confirmed.

    Thanks and Regards,

    Praful

    LinkedIn

  • v-sgandrathi's avatar
    v-sgandrathi
    Community Support

    Hi IshaDahra,


    Thank you Praful_Potphode  and grazitti_sapna for your response to the query.

    we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.

    Should you have any further questions, feel free to reach out.
    Thank you for being a part of the Microsoft Fabric Community Forum!

  • v-sgandrathi's avatar
    v-sgandrathi
    Community Support

    Hi IshaDahra,

     

    I wanted to follow up on our previous suggestions regarding the issue. We would love to hear back from you to ensure we can assist you further.

     

    Thank you.