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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jorgensorensen
Regular Visitor

Slicer in power bi

 

 

 

1 REPLY 1
Kishore_KVN
Super User
Super User

Hello @jorgensorensen ,

You have to create a concatenated column for the same. Before that you have to create a week column. 

For week column DAX will be as below:

Week Num = "Week " & WEEKNUM(Data[Date])

Next create a slicer column as you need using below calculation:

Slicer Value = 
Var A = CALCULATE(MINX(Data,Data[Date]),ALLEXCEPT(Data,Data[Week Num]))
Var B = CALCULATE(MAXX(Data,Data[Date]),ALLEXCEPT(Data,Data[Week Num]))
Return
Data[Week Num] &
" - " & 
YEAR(Data[Date]) &
"(" &
FORMAT(A,"dd.mm") &
" - " &
FORMAT(B,"dd.mm") &
")"

Now create a slicer sorting column called as week number sorting using below DAX:

Week Number Sorting = WEEKNUM(Data[Date])

select slicer value column and sort it with respect to slicer sorting column. 
Then take slicer value column in to your slicer then the output looks as below:

Kishore_KVN_0-1712924179588.png

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.