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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Selected Period VS previous Period

Hi all,

I need some help on below question. I have a table which contains different comments for different weeks, we do not necessarily have comment each week. However, there is ID for each week that we put comment there, like what you can see in below data. I want to have a slicer to select a date and then in another table we see the comments for both selected period and previous one. Thanks in advance.
Raha

DateStatusCommentsID
5/04/2020com16
26/04/2020com27
10/05/2020com38
7/06/2020come49
12/07/2020com510
5 REPLIES 5
lbendlin
Super User
Super User

First step: create a calculated table and feed it into the slicer.

 

Table 2 = values(Comments[Date])

 

Second step: create a measure

Visible := 
var s = SELECTEDVALUE('Table 2'[Date])
var c = max(Comments[ID])
var t = CALCULATE(max(Comments[ID]),all(Comments),Comments[Date]=s)
return c=t || c=t-1

 

Third step: use the measure to control the visibility of the comments in your table visual

lbendlin_0-1596163319772.png

 

 

Anonymous
Not applicable

Thanks so much, that was what I needed. But I can not just filter on true value. Not sure how I should do it. It is showing both true and false values.

under "Filters in this visual"  set the "Visible"  filter to "True"

amitchandak
Super User
Super User

@Anonymous , for WOW or any custom period you can so it using RANK.

Power BI — WTD Questions— Time Intelligence 4–5
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123

 

Make sure you have a separate date or period table

 

Normal period

 

Power BI — YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Power BI — QTD Questions — Time Intelligence 2–5
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
Power BI — MTD Questions — Time Intelligence 3–5
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Can anyone help me?please?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.