Forum Discussion

Skunny11's avatar
Skunny11
Frequent Visitor
6 years ago
Solved

Measure for string values?

Is it possible to use a measure to show a list of string values?   I have a table imported that has a Name column and a Date column. I want to create a measure that would list all of the names that...
  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi Skunny11 ,

     

    If you want to show the name in each rows, we can use the table visual and add the following measures as visual filter to meet your requirement:

     

     

    IsInThisMonth = 
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            AND (
                [Date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ),
                [Date]
                    < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 1, 1 )
            )
        )
    )

     

     

     

     

    IsInPreviousMonth =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            AND (
                [Date] < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ),
                [Date]
                    >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, 1 )
            )
        )
    )

     

     

     

    IsNewNamesFromPreviousMonth =
    IF ( AND ( [IsInThisMonth] > 0, [IsInPreviousMonth] = 0 ), 1, 0 )

     

     

     

    If it doesn't meet your requirement, Please show the exact expected result based on the Tables above.


    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.