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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
carlol
Helper IV
Helper IV

Default filter -- based on max/min value

I have RLS implemented 

The issue is for a user with all Access , I do not want to illustrate a graph with all options , too busy 

 

My Solution is to idenify the max ID assocaited with the Filter , have a generic name "Default" ; regardless of the options avaialble , it will always illustrate Default option based on what the user has access to 

 

Having issue with DAX

 

Something like this 

 

Max = VAR HospIDMax = Calculate(Max(DimHospital[HospitalID]),FILTER(DimHospital,DimHospital[Hospital]<>"National"))
RETURN

IFDimHospital[HospitalID] = HospIDMax), "Default",
DimHospital[Hospital]
)
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @carlol 

 

Try this:

Max =
VAR HospIDMax =
    CALCULATE(
        MAX( DimHospital[HospitalID] ),
        FILTER( DimHospital, DimHospital[Hospital] <> "National" )
    )
VAR _M =
    MAX( DimHospital[HospitalID] )
RETURN
    IF( _M = HospIDMax, "Default", _M )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
carlol
Helper IV
Helper IV

Thanks will give it a try and let you know how I get on

Anonymous
Not applicable

Hi @carlol ,

 


Could you tell me if @VahidDM 's post helps you? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.

 

Best Regards,
Eyelyn Qin

VahidDM
Super User
Super User

Hi @carlol 

 

Try this:

Max =
VAR HospIDMax =
    CALCULATE(
        MAX( DimHospital[HospitalID] ),
        FILTER( DimHospital, DimHospital[Hospital] <> "National" )
    )
VAR _M =
    MAX( DimHospital[HospitalID] )
RETURN
    IF( _M = HospIDMax, "Default", _M )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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