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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Access to multiple values from a measure

Dear all,

 

I have a measure that works fine, and returns me a count of rows for each blank date, as below.

The relationship between the two tables is the "employee ID", and the date is "dismissal date".

 

Count by Period =
CALCULATE(
COUNTROWS('TABLE_1');
FILTER(ALL('TABLE_2');
'TABLE_2'[Date] = BLANK()
)
)

 

I´m trying to access the values of it. I wanted something like this, but couldn´t figure out how to do it:

 

Values by Period = 
CALCULATE(
VALUES('TABLE_1');
FILTER(ALL('TABLE_2');
'TABLE_2'[Date] = BLANK()
)
)

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

After some work, I found a solution that worked for me. In case you have better ones, let me know.

 

Instead of working with a Measure, I actually added a calculated column with similar sintax:

 

Status per Period =
IF(
   RELATED('TABLE_1'[Date of Dismissal].[Date]) < STARTOFMONTH('TABLE_2'[Period of earnings].[Date])
   || RELATED('TABLE_1'[Date of Dismissal].[Date]) > ENDOFMONTH('TABLE_2'[Period of earnings].[Date])
   || RELATED('TABLE_1'[Date of Dismissal].[Date]) = BLANK()
   ; "Active"
   ; "Dismissed"
)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

After some work, I found a solution that worked for me. In case you have better ones, let me know.

 

Instead of working with a Measure, I actually added a calculated column with similar sintax:

 

Status per Period =
IF(
   RELATED('TABLE_1'[Date of Dismissal].[Date]) < STARTOFMONTH('TABLE_2'[Period of earnings].[Date])
   || RELATED('TABLE_1'[Date of Dismissal].[Date]) > ENDOFMONTH('TABLE_2'[Period of earnings].[Date])
   || RELATED('TABLE_1'[Date of Dismissal].[Date]) = BLANK()
   ; "Active"
   ; "Dismissed"
)

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.