cancel
Showing results 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.

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

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

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

Responsive Resident

Thank you!

Announcements

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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors