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
deb_power123
Helper V
Helper V

Any DAX to compare system time with latest 3 week numbers and preselect it?

Hi All,

 

Is there any available settings or way to handle preselection of the checkboxes in PowerBI?

 

I want the latest WeekNumbers to be always preselected in my visualization. Weeknumber should correspond to the system date.

 

Is there a way to achieve this ,may be using DAX?

 

The one pointed in blue arrow represents the latest 3 week numbers which I want to be preselected should always correspond to the system time. We are at present in week number 20 so the latest three weeknumber is Week17,Week18 and Week 20 so these three values should be preselected in the filter of the visualization.

 

Is it possible ? if so then how?

 

(I have used this DAX to calculate the weeknumber)

 

WeekNumber = WEEKNUM([Date]),21)

 

Expected output:

error_ticket.JPG

 

Input data :

 

DateLocation %attendance
01.12.2020   B170
01.12.2020   B120
01.12.2020   B161
02.12.2020   B230
01.05.2021   B329
01.05.2021   B380
03.05.2021   B322
04.05.2021   B420
18.05.2021   B561
19.05.2021   B130
20.05.2021   B229
21.05.2021   B380
22.05.2021   B454
23.05.2021   B438

 

Kind regards

Sameer

 

1 REPLY 1
mahoneypat
Employee
Employee

This article has several version of Date tables that all include a column called WeeksFromNow that you could use to filter any of your visuals where WeeksFromNow <=0 and WeeksFromNow>= -3.

No Sort Date Tables! – Hoosier BI

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.

Top Solution Authors