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
Farrah24
Frequent Visitor

Shows data partially based on percentage selected in slicer

Hi!

So i hava data of app index per day. I want to show it in graph, consist of app index in y-axis and elapsed day in x-axis. 

I want to show the data based on the selected data percentage in slicer. For example, I have in total 9039 data. if i select 10% they will only show 10% of the data from the back which is data 8135 to 9039 (Total 904 data showed). How do i make it on dax?

Farrah24_0-1672890405376.png

Thanks in advance!

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

Hi @Farrah24 ,

 

Here I suggest you to create a measure and add this measure as a visual level filter in your line chart. In my sample, I create a percentage slicer by what if parameter.

Filter = 
VAR _PERCENTAGE =
    DIVIDE ( SELECTEDVALUE ( Percentage[Percentage] ), 100 )
VAR _MAXINDEX =
    CALCULATE ( MAX ( 'Table'[Index] ), ALL ( 'Table' ) )
VAR _ROUNDUP =
    ROUNDUP ( _MAXINDEX * _PERCENTAGE, 0 )
VAR _RESULT =
    IF ( MAX ( 'Table'[Index] ) >= _MAXINDEX - _ROUNDUP, 1, 0 )
RETURN
   _RESULT

Result is as below.

RicoZhou_0-1672992709455.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @Farrah24 ,

 

Here I suggest you to create a measure and add this measure as a visual level filter in your line chart. In my sample, I create a percentage slicer by what if parameter.

Filter = 
VAR _PERCENTAGE =
    DIVIDE ( SELECTEDVALUE ( Percentage[Percentage] ), 100 )
VAR _MAXINDEX =
    CALCULATE ( MAX ( 'Table'[Index] ), ALL ( 'Table' ) )
VAR _ROUNDUP =
    ROUNDUP ( _MAXINDEX * _PERCENTAGE, 0 )
VAR _RESULT =
    IF ( MAX ( 'Table'[Index] ) >= _MAXINDEX - _ROUNDUP, 1, 0 )
RETURN
   _RESULT

Result is as below.

RicoZhou_0-1672992709455.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Farrah24 , One you mutiple measure by 10%

 

[Measure]*[Parameter value]/100

 

or use this parameter with pareto logic, refer my filter example at end

 

Continue to explore Power BI Window function- Pareto Analysis, 80% of sales, Order by on Measure: https://www.youtube.com/watch?v=UVxiLc_AzSs

 

This mean 10% contribution

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.