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
krikas
Helper I
Helper I

Dynamic time period level (quarter/month) on axis using slicer

Hi everyone,

 

I have a case where, I would like to have a slicer where user can select "Quarter" and "Month" - and this will change the axis.

 

When selecting Quarter, then quarters in selected year are returned in charts, e.g. 2020Q1, 2020Q2, 2020Q3, 2020Q4 when 2020 is selected as Year.

 

I have 2 measures in my charts in the same page, SUM of something (e.g. Sales) and a SPLY measure.

 

My challenge is the SPLY measure.  In my sample file, you can see SPLY results is wrong, e.g. if year = 2020, then SPLY results are presented in 2019.

 

Sample:

https://drive.google.com/file/d/14RqPnffz-gF64u2G4zdptP8nEugruiBo/view?usp=sharing

3 REPLIES 3
v-yuaj-msft
Community Support
Community Support

Hi @krikas ,

 

Please check this blog whether it can help you.

 

Best Regards,

Yuna

Anonymous
Not applicable

Hi @krikas 

 

You need to create an additional table. 

 

Write a query using selectcolumns to append quarter and month data and union them.

 

Post this use a treats fn for example - calculate(sales,treatas(values(from the newly appended field,quarter-year from your date table,treatas(values(from the newly appended field,month-year from your data table)

 

This will give you result.

Hi @Anonymous 

Thanks a lot for your input. I have tried to implement your suggestion - without success.

 

Do you by any change have the time to show me how in my example?

 

Thanks.

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.