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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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