Forum Discussion
Dynamic X axis via slicer
hi
i want to change my x axis dynamically via slicer(i.e week,month,year,date)
Hi Anonymous ,
We think use the hierarchy will be more flixable than slicer. We can create a hierarchy by the level "Year-Week-Day" (Drap one field to another field), use it as the x-axis field, then chang your measure to following:
Last X Days Sales Avg = VAR day = IF ( ISINSCOPE ( 'Calendar'[Year] ), -365, IF ( ISINSCOPE ( 'Calendar'[Week] ), -7, -1 ) ) RETURN CALCULATE ( AVERAGEX ( Sales, Sales[Detail.qty] ), DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), day, DAY ) )Then we can use the drilldown and drillup feature (in the top of your chart) to meet your requirement. But the measure name cannot be dynamic.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-lid-msft
Community Support
Hi Anonymous ,
We think use the hierarchy will be more flixable than slicer. We can create a hierarchy by the level "Year-Week-Day" (Drap one field to another field), use it as the x-axis field, then chang your measure to following:
Last X Days Sales Avg = VAR day = IF ( ISINSCOPE ( 'Calendar'[Year] ), -365, IF ( ISINSCOPE ( 'Calendar'[Week] ), -7, -1 ) ) RETURN CALCULATE ( AVERAGEX ( Sales, Sales[Detail.qty] ), DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), day, DAY ) )Then we can use the drilldown and drillup feature (in the top of your chart) to meet your requirement. But the measure name cannot be dynamic.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Hi,
v-lid-msft wrote:Hi Anonymous ,
We think use the hierarchy will be more flixable than slicer. We can create a hierarchy by the level "Year-Week-Day" (Drap one field to another field), use it as the x-axis field, then chang your measure to following:
Last X Days Sales Avg = VAR day = IF ( ISINSCOPE ( 'Calendar'[Year] ), -365, IF ( ISINSCOPE ( 'Calendar'[Week] ), -7, -1 ) ) RETURN CALCULATE ( AVERAGEX ( Sales, Sales[Detail.qty] ), DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), day, DAY ) )Then we can use the drilldown and drillup feature (in the top of your chart) to meet your requirement. But the measure name cannot be dynamic.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft wrote:Hi Anonymous ,
We think use the hierarchy will be more flixable than slicer. We can create a hierarchy by the level "Year-Week-Day" (Drap one field to another field), use it as the x-axis field, then chang your measure to following:
Last X Days Sales Avg = VAR day = IF ( ISINSCOPE ( 'Calendar'[Year] ), -365, IF ( ISINSCOPE ( 'Calendar'[Week] ), -7, -1 ) ) RETURN CALCULATE ( AVERAGEX ( Sales, Sales[Detail.qty] ), DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), day, DAY ) )Then we can use the drilldown and drillup feature (in the top of your chart) to meet your requirement. But the measure name cannot be dynamic.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pbix link has expired. could you please again share pbix file.