Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Column values

Hello!

 

Is there a way to bring column values to a measure? I tried using "VALUES" function but it only gives unique values and i want all of the values inside that column.

Measure =
VAR DrivingIndex = VALUES(CombinedTable[drivingindex])

RETURN [Minutes]*(100-DrivingIndex)^3

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion

    Hi, Anonymous , DAX measure is way different from Excel array formula; it's always used to aggregated data in a particular way (sum up, average, concatenate, etc.) in stead of return a series of results.

    btw, in gereral, we can use ALL(CombinedTable) to retrieve an intact table, retaining all duplicates in each column.

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous 

    Can you explain a bit more what the operation you need exactly is? The DAX code you show does not make much sense since you are multiplying by a one-column table  What is [Minutes]?

    Probably you'll need to use some kind of iterator based on the whole table, either CombinedTable or ALL(CombinedTable). In any case, we need more details to come up with an answer.

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      AlB 

       

      So i have three different measures. Minutes, WeightedNumber and WeightedAverage. I have trouble with the WeightedNumber measure because i want to bring those drivingindexes that were counted in the Minutes measure. These measures are for a cubic average for my gauge visualization. Hopefully you can get some kind of a picture what i'm trying to do. Thank you for your help anyways.

       

      Minutes =
      VAR minimi = MIN(CombinedTable[Time]) VAR maksimi = MAX(CombinedTable[Time]) return IF(ISFILTERED(CombinedTable[Date]) || ISFILTERED(CombinedTable[driver_id]);
      maksimi - minimi && COUNT(CombinedTable[drivingindex]) ; BLANK() )

      WeightedNumber =
      VAR DrivingIndex = ALL(CombinedTable[drivingindex])
      RETURN [Minutes]*(100-DrivingIndex)^3

      WeightedAverage = 100-([WeightedNumber]/[Minutes])^(1/3)

      The error message that I keep getting next to my visualization