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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
themistoklis
Community Champion
Community Champion

Slicer with selection of Date Periods (Year, Quarter, Month) that come from multiple columns

Hello All,

 

Im trying to create a slicer where I can select the period that I want (e.g. year, month and quarter) and the the date period will be populated with the correct values (First column in image below).

 

The date periods (year, quarter, month) are stored in seperate fields in a Calendar table in the report

 

Although I have seen an article explaining the methodology on how to do it... im struggling to find it.

 

Any help will be much appreciated

 

Date_Period.png

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @themistoklis 

Please correct me if I wrongly understood your question.

Please check the below picture, link, and measure whether it is what you are looking for.

 

Qty Total =
SWITCH (
SELECTEDVALUE ( 'Period Slicer'[Type] , "Year"),
"Year",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Year] )
),
"Quarter",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Quarter & Year] )
),
"Month",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Month & Year] )
),
"Week",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Week & Year] )
),
"Checkagain"
)
 
Picture1.pngPicture2.png
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @themistoklis 

Please correct me if I wrongly understood your question.

Please check the below picture, link, and measure whether it is what you are looking for.

 

Qty Total =
SWITCH (
SELECTEDVALUE ( 'Period Slicer'[Type] , "Year"),
"Year",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Year] )
),
"Quarter",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Quarter & Year] )
),
"Month",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Month & Year] )
),
"Week",
CALCULATE (
SUM ( Sales[Qty] ),
TREATAS ( VALUES ( 'Period Slicer'[Period] ), Dates[Week & Year] )
),
"Checkagain"
)
 
Picture1.pngPicture2.png
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim . Awesome content. Would you mind to share the pbix file again? Thanks 🙂

Hi,

Thank you for your feedback.

Sorry to say that I could not find the file in my computer since it has been quite a long time I created this.

By the way, this solution is, I think, already an old way. Because now we have the feature called "Field Parameter" in Power BI Desktop. This is exactly providing the same and awesome solution for the above and it is much easier. There are many Youtube videos out there (less than 10 minutes) talking about "Field Parameter" in Power BI. You can simply search for the videos by entering "Field Parameter in Power BI".

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks @Jihwan_Kim 🙂 Appreciated your time on replying.

Hello @Jihwan_Kim 

 

This is what I needed. Thanks a lot for your answer.

This will save me time.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.