Valid if (SUM of [Procent] for Selected in this row is less then ... )

So I have two columns:
[Enum list] - A , B, C, โ€ฆ
[Procent]
I need to valid if [Procent] that sum of selected from this row [Enum list] will be <= 100 %
In the other words it will be not possible to cross 100 % for sum of each A, B, C โ€ฆ when entering [Procent]

Solved Solved
0 5 434
1 ACCEPTED SOLUTION

I found solution:
in Valid if I put:

[Procent]
<=
(1 - SUM(
SELECT(
MyTable[Procent],

 [_THIS].[Enum list]
    =[Enum list])

))

View solution in original post

5 REPLIES 5

Hi,

If I have understood your requirement clearly, I believe you could try a valid_if expression something like
SUM([Enum list])<=100.00%

Assumes that [Enum list] is an โ€œEnum listโ€ type column with base type of the column as โ€œPercentโ€ โ€ฆ

No I have two columns
One is [Enum list] type as enum list for example: A, B, C
Second [Procent] type as procent

I want to valid if field [procent] in this way:
Dependly what user will choose from first field [enum list]: A, B, C
it will valid second field [Procent] that sum of [Procent] all records that have the same enum list choosen will be less than 100%

Result is that when you will try to sum [procent] by [enum list] max you will see is 100 never more.

Your first problem description and this second problem description are very different. I would be easier for us to help you if you completely and correctly describe your problem the first time.

(
  SUM(
    SELECT(
      MyTable[Procent],
      (
        (SORT([_THISROW].[Enum list]) & ".")
        = (SORT([Enum list]) & ".")
      )
    )
  )
  <= 100
)

I use for Valid If
(
SUM(
SELECT(
MyTable[Procent],

    [_THISROW].[Enum list]
    =[Enum list]
  )
)

<= 1
)
And it works but problem is that it say that number is in valid after save and sync and again editing record.
so it dosenโ€™t work like I want.

Caluleted Max Value would solve my problem but probably there is no option for that.

I found solution:
in Valid if I put:

[Procent]
<=
(1 - SUM(
SELECT(
MyTable[Procent],

 [_THIS].[Enum list]
    =[Enum list])

))

Top Labels in this Space