Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to create DAX for below query from SQL

select MAX(SeqID) from [dbo].[CT]
where [MonthId]=1

 

 

Here, CT is a calendar table.

  • Hi Anonymous 

    try this 

    Measure = calculate(MAX(CT[SeqID]);CT[MonthId]=1)
  • Hi Anonymous ,

    Try CALCULATE (MAX(CT[SeqID], CT[MonthID] = 1)

     

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel

3 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    try this 

    Measure = calculate(MAX(CT[SeqID]);CT[MonthId]=1)
  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi Anonymous ,

    Try CALCULATE (MAX(CT[SeqID], CT[MonthID] = 1)

     

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel

  • Anonymous's avatar
    Anonymous
    Not applicable

    Please help in converting below SQL query to DAX-

     

    Select A.*,(Currentmonth-1) As PreviousMonth from ( select max([SeqID])AS Currentmonth
    from [dbo].[CT]
    where [Month]=1)A