cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
arpitupd Frequent Visitor
Frequent Visitor

How to create DAX for below query from SQL

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

 

 

Here, CT is a calendar table.

2 ACCEPTED SOLUTIONS

Accepted Solutions
az38 Member
Member

Re: How to create DAX for below query from SQL

Hi @arpitupd 

try this 

Measure = calculate(MAX(CT[SeqID]);CT[MonthId]=1)

View solution in original post

Nathaniel_C Super Contributor
Super Contributor

Re: How to create DAX for below query from SQL

Hi @arpitupd ,

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

View solution in original post

3 REPLIES 3
az38 Member
Member

Re: How to create DAX for below query from SQL

Hi @arpitupd 

try this 

Measure = calculate(MAX(CT[SeqID]);CT[MonthId]=1)

View solution in original post

Nathaniel_C Super Contributor
Super Contributor

Re: How to create DAX for below query from SQL

Hi @arpitupd ,

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

View solution in original post

arpitupd Frequent Visitor
Frequent Visitor

Re: How to create DAX for below query from SQL

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 432 members 4,402 guests
Please welcome our newest community members: