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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors