Forum Discussion
gghlyon
1 year agoFrequent Visitor
Additional filter on TreatAs limiting Values
Hi, I have a ENGINEER table, and an unrelated TICKET table where I'm trying to sum hours with a measure. I can't link them for other reasons. I wish to filter the ticket table by the enginee...
- Anonymous1 year ago
Hi gghlyon ,
You can follow the steps below to get it:
1. Create a slicer base on the field 'ENGINEER'[Dept]
2. Create a measure as below to get Rocketry Hours
Rocketry Hours = VAR _depts = ALLSELECTED ( 'ENGINEER'[Dept] ) VAR _engineers = CALCULATETABLE ( VALUES ( 'ENGINEER'[FullName] ), FILTER ( 'ENGINEER', 'ENGINEER'[Dept] IN _depts ) ) RETURN CALCULATE ( SUM ( 'TICKET'[ActualHours] ), FILTER ( 'TICKET', 'TICKET'[HelpdeskEmployeeName] IN _engineers ) )If the above one can't help you, please provide some raw data in your tables 'ENGINEER' and 'TICKET' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
johnt75
Super User
1 year agoTry
Rocketry Hours =
VAR FilteredEngineers =
CALCULATETABLE (
VALUES ( 'ENGINEER'[FullName] ),
'ENGINEER'[Dept] = "Rocketry"
)
VAR Result =
CALCULATE (
SUM ( TICKET[ActualHours] ),
TREATAS ( FilteredEngineers, TICKET[HelpdeskEmployeeName] )
)
RETURN
Result