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
Anonymous
Not applicable

Need help with creating cut points for a categorical rating

I am looking to use a secondary table to generate a star rating. The data is given as a percentage between 0 and 100 rounded to the tenths place. There is a secondary table with the start and end of the range for each star rating. I am looking for a way to reference between the tables. Examples below. 

 

For example this is the data I have 

ID NumberTimely Initiation of careMobilityIn/Out of BedBathingLess Pain
1700096.679.668.276.365.6
170099583.678.583.888.2
1701399.277.976.38691.3
1701498.382.379.483.188.9
1701699.685.584.987.894.2
170189885.983.491.789.7
1702098.293.682.78793.6
1702499.289.284.588.396.6
1702597.278.173.376.178.3
1702687.674.571.376.677.1
1702799.784.887.291.884.5
1702886.985.280.883.385.3
1703498.58382.689.188.6
1703599.883.687.488.990.8
1703798.683.285.186.894.4
1703998.888.481.991.694.3
1704898.684.276.59094.2
1705073.753.768.866.466.2
1705197.873.673.978.680.9
1705298.581.18187.383
170539986.882.191.185.9
1705493.678.575.58382.1
1705596.777.578.183.787.8
1705694.575.474.281.287.4
170589980.179.886.285.3
1706398.568.969.480.575.7
1706693.371.176.376.476.8
1706796.480.383.284.779.2
1706998.992.286.592.795.9
1707097.678.577.484.687.8
1707198.887.883.692.788.6
170729986.980.575.184.2

 

And this is the reference table with the ending of .1 being the lower bound of that star rating and .2 being the upper bound.

Star RatingTimely Initiation of Care.1Timely Initiation of Care.2Mobility.1Mobility.2In/Out Bed.1In/Out Bed.2Bathing.1Bathing.2Less Pain.1Less Pain.2
0.5082.6057053.6055.8053.9
182.78957.16553.762.855.965.55464.4
1.589.192.465.17062.968.765.670.964.570.6
292.594.870.173.268.872.67174.870.775.4
2.594.996.373.375.772.775.574.977.975.579
396.497.475.87875.677.87880.579.182.4
3.597.598.378.180.577.980.380.683.282.585.9
498.49980.683.780.483.183.386.48689.7
4.599.199.683.888.183.287.686.59189.894.5
599.710088.210087.710091.110094.6100

 

The goal is to assign a star rating for each category to each row in the initial data. Looking for a way to do this as a reference to this second table since that table is updated quarterly.

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create measures

Capture13.JPG

Measure_bathing = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Bathing])>=Sheet5[Bathing.1]&&MAX(Sheet4[Bathing])<=Sheet5[Bathing.2]))

Measure_bed = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[In/Out of Bed])>=Sheet5[In/Out Bed.1]&&MAX(Sheet4[In/Out of Bed])<=Sheet5[In/Out Bed.2]))

Measure_care = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Timely Initiation of care])>=Sheet5[Timely Initiation of Care.1]&&MAX(Sheet4[Timely Initiation of care])<=Sheet5[Timely Initiation of Care.2]))

Measure_mobility = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Mobility])>=Sheet5[Mobility.1]&&MAX(Sheet4[Mobility])<=Sheet5[Mobility.2]))

Measure_pain = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Less Pain])>=Sheet5[Less Pain.1]&&MAX(Sheet4[Less Pain])<=Sheet5[Less Pain.2]))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

zz

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create measures

Capture13.JPG

Measure_bathing = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Bathing])>=Sheet5[Bathing.1]&&MAX(Sheet4[Bathing])<=Sheet5[Bathing.2]))

Measure_bed = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[In/Out of Bed])>=Sheet5[In/Out Bed.1]&&MAX(Sheet4[In/Out of Bed])<=Sheet5[In/Out Bed.2]))

Measure_care = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Timely Initiation of care])>=Sheet5[Timely Initiation of Care.1]&&MAX(Sheet4[Timely Initiation of care])<=Sheet5[Timely Initiation of Care.2]))

Measure_mobility = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Mobility])>=Sheet5[Mobility.1]&&MAX(Sheet4[Mobility])<=Sheet5[Mobility.2]))

Measure_pain = CALCULATE(MAX(Sheet5[Star Rating]),FILTER(Sheet5,MAX(Sheet4[Less Pain])>=Sheet5[Less Pain.1]&&MAX(Sheet4[Less Pain])<=Sheet5[Less Pain.2]))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

zz

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.