Forum Discussion
Calculate filter based on multiple table variables
Hi IvensaMDH ,
Please try to use SUMMARIZE() to filter table, then you could reference the columns. For example:
Measure =
var A= SUMMARIZE(FILTER('Data',[Type]=1),[Time],[Sla])
var B= SUMMARIZE(FILTER('Data',[Type]=2),[Time])
var C= SUMMARIZE(FILTER('Data',[Type]=3),[Sla])
RETURN CALCULATE(COUNTROWS(A) / COUNTROWS(B) * COUNTROWS(C), FILTER(A,[Time]>MAXX(B,[Time]) &&[Sla]>MAXX(C,[Sla])))
If you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data to help us clarify your scenario.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- IvensaMDH4 years agoFrequent Visitor
Hi Anonymous ,
Thanks for your solution - I do, however, realize that my initial question perhaps was not entirely what i really was looking for.
Given a table like below, could you suggest a way to calculate the difference between the time of rows with type 1 against rows with type 2 of the same Id.
ie. the difference between [Time] of row 1 with [Type] = 1 and [Time] of row 2 with [Type] = 2
and for rows 4 and 5 as well since they have the same Id and Type 1 and 2
Id Type Time 1 1 15-03-2022 10:00:00 1 2 15-03-2022 11:00:00 2 1 15-03-2022 10:00:00 3 1 15-03-2022 10:00:00 3 2 15-03-2022 12:00:00 4 2 15-03-2022 13:00:00 To clarify, the table is logging events of different [Type] as well as the [Time] of that event and an associated [Id] of the entity producing that event. I would like to find all Id's which has an event of Type=1 AND THEN (based on Time) and event of Type=2.
The result should ideally be a table of Ids and Times:
Id Type 1 Time Type 2 Time 1 15-03-2022 10:00:00 15-03-2022 11:00:00 3 15-03-2022 10:00:00 15-03-2022 12:00:00 Do you have any suggestions as to how i can achieve this?
Thanks in advance!/M