cancel
Showing results for 
Search instead for 
Did you mean: 
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

2 REPLIES 2
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


Ritaf
Responsive Resident
Responsive Resident

Thank you!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors