Forum Discussion
Measure for string values?
- 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.
Ah ok gotcha, that seemed to have worked, I am assuming there is no way to get each of these server names into their own row?
Also if I were to try and display the previous months server names I try the followin gbut it returns blank, ive also tried PREVIOUSMONTH as well:
Measure_Names_Previous_Month =
VAR PreviousMonth_ = DATEADD(Table1[Date], -1, MONTH)
RETURN
CONCATENATEX
(
CALCULATETABLE
(
DISTINCT ( Table1[Name] ),
MONTH(Table1[Date]) = PreviousMonth_
),
Table1[Name],
", "
)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.