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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Julian1
Microsoft Employee
Microsoft Employee

How do measure conflicting values for only specific conflicts?

I have a table with a set of times and activities, like the one shown below. There can be multiple rows with a given time for overlapping activities, such as the first two rows below that show both Soccer and Football are being played at 10/1/2020 5:00 PM:

DateTimeActivity
10/1/2020 5:00 PMSoccer
10/1/2020 5:00 PMFootball
10/1/2020 6:00 PMTennis
10/1/2020 7:00 PMSoccer
10/1/2020 7:00 PMTennis

 

I'd like to create a measure with a count of all the time slots that have conflicting activities, but only for specific conflicts. As an example, theres a conflict at 10/1/2020 5:00 PM since both Soccer and Football would use the same playing field. However, there's not a conflict at 10/1/2020 7:00 PM even though there are 2 activities at the same time, since Soccer and Tennis use different playing fields. 

 

I tried to use GroupBy for this but couldn't figure out how to interrogate CurrentGroup() to find out if the specific conflicts I needed to detect were there. Thoughts welcome. 🙂

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Julian1,

I think you need to add a calculated column or active type table to group current activity types then you can simply use date and type to check the conflicting activities. 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Julian1 , I will two-step approach

I will create first this column

This can var in another column

New Activity =
Switch( True(),
[Activity] in {"Soccer", "Football"} , "SoccerFootball",
[Activity]
)

 

And this conflict column.

conflict = countx(filter(table, [DateTime] =earlier([DateTime]) && [Activity] =earlier([Activity])),[Activity])

 

measure

conflict = countx(filter(allselected(table), [DateTime] =max([DateTime]) && [Activity] =max([Activity])),[Activity])

 

conflict > 1 is what you are looking for

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.