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.
Hi,
I am trying to use a measure to determine which time has the highest amount of traffic. The goal is to display the Time with the highest amount on a Card within PowerBI. The problem I run into is there are two values, both with the highest amount and I receive an error. In this case, I would want to display the first instance (in the example below, I need the return value as 10:00am).
Error: MdxScript(Model) (4, 41) Calculation error in measure 'Sheet1'[MAX Interval]: A table of multiple values was supplied where a single value was expected.
I am using this:
Sample Table
Store | DOW | Time | Amount |
A | Tuesday | 10:00 AM | 100 |
A | Tuesday | 10:30 AM | 99 |
A | Tuesday | 11:00 AM | 100 |
A | Tuesday | 11:30 AM | 87 |
B | Tuesday | 10:00 AM | 33 |
B | Tuesday | 10:30 AM | 77 |
Solved! Go to Solution.
Try this
Max Interval = CALCULATE(MIN(Sheet1[Time]),FILTER(Sheet1,Sheet1[Amount]=MAX(Sheet1[Amount])))
Regards
Phil
Proud to be a Super User!
Hi,
Write these measures:
Total amount = SUM(Data[Amount])
Measure = FIRSTNONBLANK(TOPN(1,VALUES(Data[Time]),[Total amount],DESC),1)
Try this
Max Interval = CALCULATE(MIN(Sheet1[Time]),FILTER(Sheet1,Sheet1[Amount]=MAX(Sheet1[Amount])))
Regards
Phil
Proud to be a Super User!
Ugh. I had the wrong filter. Thank you.
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 |
---|---|
106 | |
105 | |
88 | |
75 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |