Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
we have installed a lot of IoT devices in US and EU, I would like to check if
minimum voltage of devices installed in US insider range: 5V -12V
minimum voltage of devices installed in EU insider range: 5V -9V
if above condition satisfied, then notification should return value 1,
the table visual as result will be like following:
IoT device ID | Min Voltage | Region | notification |
1122 | 11 | EU | 0 |
1133 | 8 | EU | 1 |
1145 | 15 | US | 0 |
1155 | 11 | US | 1 |
I have following code
I got following Error Message:
MdxScript(Model) (127, 1) Calculation error in measure 'Notification'[MinVoltageN]: A table of multiple values was supplied where a single value was expected.
appreciate your help and comment!
Thanks in advance!
Solved! Go to Solution.
Try
MinVoltageN =
IF (
ISINSCOPE ( TRACKSHEET[REGION] ),
VAR _minV =
MIN ( datatable[VOLTAGE] )
VAR _showminvoltage =
SWITCH (
TRUE (),
VALUES ( TRACKSHEET[REGION] ) = "EU"
&& _minV < 9
&& _minV > 5, 1,
VALUES ( TRACKSHEET[REGION] ) = "US"
&& _minV < 12
&& _minV > 5, 1,
BLANK ()
) -- Notification
VAR _Notificationminvol =
IF ( _showminvoltage, 1, 0 )
RETURN
_Notificationminvol
)
Try
MinVoltageN =
IF (
ISINSCOPE ( TRACKSHEET[REGION] ),
VAR _minV =
MIN ( datatable[VOLTAGE] )
VAR _showminvoltage =
SWITCH (
TRUE (),
VALUES ( TRACKSHEET[REGION] ) = "EU"
&& _minV < 9
&& _minV > 5, 1,
VALUES ( TRACKSHEET[REGION] ) = "US"
&& _minV < 12
&& _minV > 5, 1,
BLANK ()
) -- Notification
VAR _Notificationminvol =
IF ( _showminvoltage, 1, 0 )
RETURN
_Notificationminvol
)
Thanks, It works.
could you help me to understand what could be the problem behid my code?
Thanks in advance!
My guess is that the problem was triggered in the total line of a table or matrix value. If the region wasn't filtered down to a single value, as would be the case for a total, then VALUES will return all the regions as a table, and you can't compare a table with multiple rows with a scalar value. By checking ISINSCOPE you are guaranteeing that there will be only 1 value returned and so you can compare that to a scalar value.
thank you very much
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |