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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
danextian
Super User
Super User

Simulation whether numbers in a column is within the upper limit set on a numeric slicer

Hi All,

 

I entered this formula as a measure 

upperlimit = 
CALCULATE ( MIN ( 'Table'[Days] ), ALLSELECTED ( 'Table'[Days] ) )

 

My goal is to set this  measure as upper limit to simulate whether the values in a column is within or beyond SLA. I'm using a numeric slicer to set the limit. It works fine on a card but not when using this measure in a column.

 

Here is the formula for my column

Within/Beyond = IF (
        'table'[Column] <= upperlimit,
        " within",
        "beyond")

This formula  doesnt work at all. 

When I try to return the value of upperlimit within this column, the result is just plain zero and not the number on the slicer.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
7 REPLIES 7
v-haibl-msft
Microsoft Employee
Microsoft Employee

@danextian

 

You need to use calculated measure to get the desired result. You can first duplicate the original Table which only includes Days column. So there will be two same tables (Table and Table2) with one Days column.

 

Then create two measures with following formula.

upperlimit = 
CALCULATE ( MIN ( 'Table2'[Days] ), ALLSELECTED ( 'Table2'[Days] ) )

 

 

Measure =
IF ( CALCULATE ( MAX ( 'Table'[Days] ) ) <= [upperlimit], "within", "beyond" )

 

Create a table visual in the canvas, drag Days column and Measure into it.

Create a slicer visual in the canvas, drag 'Table2'[Days] into it.

 

2017-04-20_180922.jpg

 

Best Regards,
Herbert

@v-haibl-msft,

 

thanks for that. I've given up on using a calclulate column to achieve my desired result (would have been better if it was possible) and just use measures instead. I should have know that I could not make the values  of calculated column dynamic based on the chosen value from a slicer. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
GilbertQ
Super User
Super User

Hi @danextian

 

What about another option where you use the Enter Data and put in a column which will be the value you want for your SLA.

EG: Column Name: SLA

      Table name: SLA Limit

 

Then create a measure for your SLA table.

EG: 

SLA Number = MIN('SLA Limit'[SLA])


Then when you create your column instead of using a measure called "UPPER LIMIT" instead you pass the Value from your new table?

EG: 

SLA Column = IF('TableName'[Amount] <= [SLA Number],"LOW","HIGHER") 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ,

 

I think i followed the same approach initially. 

I created a measure 

upper limit = calculate(min('SLA TAble'[SLA]),ALLSELECTED(('SLA TAble'[SLA])))

 

I checked that the measure was working fine. So if I enter 7, the measure when used in a card shows 7. However when i use this measure in a column, it returns  zero. SLA Column = upper limit 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian


What is the reason for using the ALLSELECTED?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

While a calculated column accepts ALLSELECTED, unfortunately, it doesn't do anything. It doesn't show the value that is within speicified filters. 😞





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

If I dont use ALLSELECTED, the measure will not respect my filter so it will show the lowest value in the table regardless of the filter for Days.  If i use all, the lowest value will always be shown regardless of the value selected from the slicer.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.