Forum Discussion

Ritaf's avatar
Ritaf
Responsive Resident
4 years ago
Solved

Dynamic classification by measure

Hi,
I have a purchases table and suppliers table and want to classify every supplier by the value of purchases dynamically depending on the selected period.
I tried to add a calculated column to a suppliers table with the formula:

clasification = SWITCH(true(),
[totalValue] >0 && [totalValue] <45, "A",
[totalValue] >46 && [totalValue] <65,"B","C")
but it works staticly, how can i change the solution for dynamic?
sample file:
sample File 

  • Hi,

    I am not sure if I understood your question correctly, but please check the attached pbix file.

    I created a measure like below, and inserted into the table visualization.

     

    clasification measure: =
    IF (
        [totalValue] <> BLANK (),
        SWITCH (
            TRUE (),
            [totalValue] > 0
                && [totalValue] < 45, "A",
            [totalValue] > 46
                && [totalValue] < 65, "B",
            "C"
        )
    )
    

3 Replies

  • Hi,

    I am not sure if I understood your question correctly, but please check the attached pbix file.

    I created a measure like below, and inserted into the table visualization.

     

    clasification measure: =
    IF (
        [totalValue] <> BLANK (),
        SWITCH (
            TRUE (),
            [totalValue] > 0
                && [totalValue] < 45, "A",
            [totalValue] > 46
                && [totalValue] < 65, "B",
            "C"
        )
    )
    
    • StalinRapaka's avatar
      StalinRapaka
      New Member

      Hi Kim, I have the similar scenario, however my table will contain only classification & measures(i.e., totals, %), but not the other Grouped fields (i.e., here the supplier name & year). When Im removing the supplier name & year from the given dashboard the classification is defaulting to "C". Any suggestions please....