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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
bballjoe12
Frequent Visitor

Translating SQL command to DAX Measure Help!

I'm trying to create a DAX measure that would grab me the values from a table similar to what this SQL command would do.

 

SELECT TicketNumber

WHERE Group LIKE "DS_*"

AND GroupChangeFlag >=1

AND GroupSeqNum > 1

 

I am failing miserably and have looked all over the internet.  If the measure would just display the Ticket Numbers that would be perfect!

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bballjoe12 ,

 

You can create a measure.

Measure = 
IF (
    LEFT ( MAX ( 'Table'[Group] ), 2 ) = "DS"
        && RIGHT(MAX('Table'[Group]),1)= "*"
        && MAX ( 'Table'[GroupChangeFlag] ) >= 1
        && MAX ( 'Table'[GroupSeqNum] ) > 1,
    1
)

 

Sample data

vstephenmsft_0-1644306751265.png

 

Put the measure into visual level filters, set show items when the value is 1.

vstephenmsft_1-1644306835242.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @bballjoe12 ,

 

You can create a measure.

Measure = 
IF (
    LEFT ( MAX ( 'Table'[Group] ), 2 ) = "DS"
        && RIGHT(MAX('Table'[Group]),1)= "*"
        && MAX ( 'Table'[GroupChangeFlag] ) >= 1
        && MAX ( 'Table'[GroupSeqNum] ) > 1,
    1
)

 

Sample data

vstephenmsft_0-1644306751265.png

 

Put the measure into visual level filters, set show items when the value is 1.

vstephenmsft_1-1644306835242.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

bballjoe12
Frequent Visitor

Hello! Thank you for the response.  The table that I am using is currently part of a larger dataset, that I am not the owner of.  It seems that the New Table icon is grayed out and I can only create a new measure or a quick measure.  Can I still use your syntax by creating a new measure?

 

bballjoe12_0-1643676014359.png

 

@bballjoe12 

 

You can use the filter section in your measure to find the result

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

VahidDM
Super User
Super User

Hi @bballjoe12 

 

Is it Access Code?
You can use this to create a new table with one column as Ticket Numbers and all filters:

 

New Table =
CALCULATETABLE (
    VALUES ( table[TicketNumber] ),
    FILTER (
        table,
        LEFT ( table[Group], 2 ) = "DS"
            && LEN ( table[Group] ) >= 3
            && Tble[GroupChangeFlag] >= 1
            && table[GroupSeqNum] > 1
    )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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