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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MarioCadena
Helper II
Helper II

Dynamic Barchart

I created a calculated column to create the below groups which are split based on the diff in days between one day and today()

Below 7

Between 7 and 14

More than 14 

 

MarioCadena_1-1608092553524.png

 

I was asked if it is possible to create a parameter that allows you to change the day diff you want to split the groups into. 

 

Regards,

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

Hi @MarioCadena ,

 

Please do like this.

1. Create a "What If Parameter".

2. Create such a measure.

Expected Delivery - No subscribed = 
SWITCH(
    TRUE(),
    MAX([Delivered?]) = "Yes" && MAX([Subscribed?]) = "No", 10,
    MAX([Delivered?]) = "No" && MAX([Subscribed?]) = "No" && DATEDIFF(TODAY(), MAX([Expected Delivery Date]), DAY ) <= [Parameter Value], 5,
    MAX([Delivered?]) = "No" && MAX([Subscribed?]) = "No" && DATEDIFF(TODAY(), MAX([Expected Delivery Date]), DAY ) > [Parameter Value], 0
)

v-lionel-msft_1-1608259654738.png

 

Best regards,
Lionel Chen

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

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @MarioCadena ,

 

Please do like this.

1. Create a "What If Parameter".

2. Create such a measure.

Expected Delivery - No subscribed = 
SWITCH(
    TRUE(),
    MAX([Delivered?]) = "Yes" && MAX([Subscribed?]) = "No", 10,
    MAX([Delivered?]) = "No" && MAX([Subscribed?]) = "No" && DATEDIFF(TODAY(), MAX([Expected Delivery Date]), DAY ) <= [Parameter Value], 5,
    MAX([Delivered?]) = "No" && MAX([Subscribed?]) = "No" && DATEDIFF(TODAY(), MAX([Expected Delivery Date]), DAY ) > [Parameter Value], 0
)

v-lionel-msft_1-1608259654738.png

 

Best regards,
Lionel Chen

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

@MarioCadena , what do you mean by parameter here.

If you need it dynamic based on a selected date, you need to create a measure and then use an independent bucket table and create a new measure with row context

 

measure =
var _max = maxx(allselected('Date'),'Date'[Date])
return
datediff(max(Table[Date]),_max, DAY)

 

refer how to do dynamic segmentation https://www.youtube.com/watch?v=CuczXPj0N-k

 

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

Sorry if I don't explain myself correctly.

 

I have created a calculated column that shows items that are going to expire within the following 7 days and more than 7 days.

 
Expected Delivery - No subscribed = SWITCH(true(),
'Sales Support'[Delivered?]="Yes" && 'Sales Support'[Subscribed?] = "No",10,
'Sales Support'[Delivered?]="No" && 'Sales Support'[Subscribed?] = "No" && DATEDIFF(TODAY(),'Sales Support'[Expected Delivery Date],DAY)<=7,5,
'Sales Support'[Delivered?]="No" && 'Sales Support'[Subscribed?] = "No" && DATEDIFF(TODAY(),'Sales Support'[Expected Delivery Date],DAY)>7,0)
 

I was asked whether there is a way to make number 7 dynamic by a parameter or slicer that affects the previous chart.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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