Forum Discussion

Arnault_'s avatar
Arnault_
Resolver III
3 years ago
Solved

MIN value / Virtual table

Hi All, Here is my problem. I have a simple table with transactions with different supply centers and different prices. I have created a table where I have the 3 supply centers and the average pri...
  • johnt75's avatar
    3 years ago
    Price (Average) - MIN All Supply Center v2 = 
    MINX (
        CALCULATETABLE(
            ADDCOLUMNS ( VALUES ( Data[supply_center] ), "Price", [Price (Average)] ),
            REMOVEFILTERS(Data)
        ),
        [Price]
    )
  • PabloDeheza's avatar
    3 years ago

    Hi there!

    Try this!

    Price (Average) - MIN All Supply Center v3 = 
    VAR _Value =
    MINX (
        ALL ( Data[supply_center] ),
        CALCULATE( AVERAGE( Data[unit_price] ) )
    )
    RETURN
    IF( 
        HASONEVALUE( Data[supply_center] ),
        _Value,
        BLANK()
    )

    Should return the following:

    Let me know if that helps!

     

  • Arnault_'s avatar
    3 years ago

    I finally found the solution myslef.

    Price (Average) MIN v3 = 
    CALCULATE ( MINX
         ( VALUES ( Data[supply_center] ) ,
        [Price (Average)]
    ), ALL (Data[supply_center] )
    )