Forum Discussion

LauritzPBI_O's avatar
LauritzPBI_O
Frequent Visitor
3 years ago

Help with filtering table based on filter string

I hope someone can help with this problem.

So I'm trying to create a DAX measure, that needs to filter some account numbers in a table based on a string.
The string contains both ranges and specific account numbers, and looks like this:
01011..01090|01901..01902|01904..01959|01980..01998 

I can then fetch that value in my measure with this variable:

VAR FilterString =
    CALCULATE(
        SELECTEDVALUE( 'Account Schedule'[Totaling]),
        'Account Schedule'[Row No_] = "01090"
    )

However, how do i then translate that string into a useable filter?

5 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi LauritzPBI_O 

    would you please clarify a bit more. Which column is which. Would be great if you could provide some sample data along with the expected result. 

    • LauritzPBI_O's avatar
      LauritzPBI_O
      Frequent Visitor

      Hey thanks for looking into it!
      I couldn't seem to attach a file here, so I've made the simplified dataset as a table here.
      So ideally I need to sum the values in the "Amount" column, but only for the accounts in "AccountNo" column, that has to be filtered by the filterstring.

      AccountNoAmount
      01001100
      01005100
      01010100
      01020100
      01021100
      01022100
      01023100
      01024100
      01025100
      01026100
      01027100
      01028100
      01029100
      01030100
      01031100
      01032100
      01033100
      01034100
      01035100
      01037100
      01039100
      01080100
      01085100
      01090100
      01100100
      01105100
      01110100
      01115100

       

      • tamerj1's avatar
        tamerj1
        Community Champion

        LauritzPBI_O 

        You may upload to any cloud or file transfer service and share the download link.