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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Giada_Togliatti
Post Patron
Post Patron

measure in a slicer

Hi, 

I've this formula:

% =
VAR activitystart =MAX ( Fact_Pianificazione[Data_Inizio_Pianificata] )
VAR activityend = MAX ( Fact_Pianificazione[Data_Fine_Pianificata] )
VAR selecteddate = TODAY()
VAR activitytotaldays = activityend - activitystart + 1
RETURN
SWITCH (
TRUE (),
activityend <= selecteddate, 1,
activitystart <= selecteddate
&& activityend > selecteddate,
( selecteddate - activitystart + 1 ) / activitytotaldays,
activitystart > selecteddate, 0
)
This gives me result from 0 to 100
I need to create something that filter result= 0 and result different from 100 and put it in a slicer.
How can I do?
Thank you
1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @Giada_Togliatti 

Measure cannot be applied to the slicer, it is recommended to convert the measure into a calculated column.

%_column = 
VAR activitystart = Fact_Pianificazione[Data_Inizio_Pianificata]
VAR activityend = Fact_Pianificazione[Data_Fine_Pianificata]
VAR selecteddate = TODAY()
VAR activitytotaldays = activityend - activitystart + 1
RETURN
SWITCH (
TRUE (),
activityend <= selecteddate, 1,
activitystart <= selecteddate
&& activityend > selecteddate,
( selecteddate - activitystart + 1 ) / activitytotaldays,
activitystart > selecteddate, 0
)

50.png

 

 

Best Regards,
Community Support Team _ Eason
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-easonf-msft
Community Support
Community Support

Hi, @Giada_Togliatti 

Measure cannot be applied to the slicer, it is recommended to convert the measure into a calculated column.

%_column = 
VAR activitystart = Fact_Pianificazione[Data_Inizio_Pianificata]
VAR activityend = Fact_Pianificazione[Data_Fine_Pianificata]
VAR selecteddate = TODAY()
VAR activitytotaldays = activityend - activitystart + 1
RETURN
SWITCH (
TRUE (),
activityend <= selecteddate, 1,
activitystart <= selecteddate
&& activityend > selecteddate,
( selecteddate - activitystart + 1 ) / activitytotaldays,
activitystart > selecteddate, 0
)

50.png

 

 

Best Regards,
Community Support Team _ Eason
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

@Giada_Togliatti , You need to generate a series from on to 100 . And the create new measure where values from this new table = %

 

Example

percent = generateseries(1,100,1)  //0.1 or .01 as step based on values 

 

new measure = countx(values(Fact_Pianificazione[ID]), if([%] = max(percent[Value]), [ID], blank()))

 

Where ID is group by need for measure values to me in range from 0 to 100

 

 

refer my video for more details

 

https://youtu.be/CuczXPj0N-k

 

or

 

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.