Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've got what is I assume a simple DAX problem.
I'm trying to SUM the number of Events in my 'Events'[CurrentValue] field only when the related 'Event Type'[Event Sub Type]="Digital Calls"
I tried:
Digital Call Minutes:=CALCULATE(SUM(Event[Current Value]),FILTER(Event, 'Event Type'[Event Sub Type]="Digital Call"))
but that throws the following error:
Warning Measure 'Measure'[Digital Call Minutes] : A single value for column 'Event Sub Type' in table 'Event Type' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
THe reason I'm doing this is because the Current Value field has multiple data types depending on the Event Sub Type - so I can't just SUM every Event Sub Type as it'll error out. All I want to do is restrict the SUM to a particular subset. I gather I'm missing something simple here!!
Edit: I should add the Event -> Event Type tables are Many to One with bi-directional filtering turned on. So each Event will have only one Event Type/SubType
Solved! Go to Solution.
Your filter function is operating over the Event table (first parameter), but then you are applying a filter from the 'event type' table. Try changing the first parameter to be 'event type'
Your filter function is operating over the Event table (first parameter), but then you are applying a filter from the 'event type' table. Try changing the first parameter to be 'event type'
Thanks Matt, that did the trick. I also had to change it to SUMX so I could convert the values to ints from strings.
I ended up with the following, which has worked:
Digital Call Minutes:=CALCULATE(SUMX(Event,VALUE(Event[Current Value])/60),FILTER('Event Type', 'Event Type'[Event Sub Type]="Digital Call"))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |