Forum Discussion

Berl21's avatar
Berl21
Icon for Helper III rankHelper III
3 years ago

Create a table with min value as a column

Hi,

 

I am still new at DAX and stumbling on this issue:

I need to create a table that shows the minimum value of a row per ID. The row value itself comes from a SQL.

This is what I wrote. In the column MININDEX for the given example, I should get a 1 everywhere. How do I correct the summarize command?

Thanks,

Pauline.

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Berl21 

    Please try

    Table Test Summarize =
    SUMMARIZE (
    'Partition_Rank_SQL',
    'Partition_Rank_SQL'[DimOpportunityId],
    'Partition_Rank_SQL'[ID_Row],
    "MININDEX",
    CALCULATE (
    MIN ( 'Partition_Rank_SQL'[ID_Row] ),
    ALL ( 'Partition_Rank_SQL'[ID_Row] )
    )
    )

    • Berl21's avatar
      Berl21
      Icon for Helper III rankHelper III

      Hi tamerj1 I just replaced ALL by ALLSELECTED and it worked! Thanks a million 🙂