Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ritaf
Responsive Resident
Responsive Resident

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 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

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"
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

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"
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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....

Ritaf
Responsive Resident
Responsive Resident

Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.