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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

How to show all preceeding data based on a selected date?

Hello, 

 

I need to create visuals that dynamically change number of distinct counts based date selected. 

I have quarterly files which is automatically loaded to Power BI. New files are appended and duplicates are removed so I don't need to store duplicate data.

cvelmonte_0-1637407597880.png

 

Now I need to create visualizations in power bi. 

1. Table showing the number of items per status - I would like the count to dynamically change based on my date selector. 

cvelmonte_0-1637406847785.png

2. Another sample visual is to show trend of status for each item per quarter

cvelmonte_1-1637406974993.png

 

The idea is really to pull all items preceeding the selected quarter and count only items with the most recent date for that selected quarter. The dax functions I used seem to only filter the specific dates associated to the quarter but wouldn't give me the all data preceeding that quarter. Appreciate your help!!!!

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , You  use time intelligence with help from date table, dates and period should be used from date table

 

QTD = CALCULATE(Max(Table[Status]),DATESQTD(('Date'[Date])))
Last QTD = CALCULATE(Max(Table[Status]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

View solution in original post

V-lianl-msft
Community Support
Community Support

Hi ,

 

 

A disconnected calendar is required.

You could create a measure like below and apply it to visual level filter.

 

 

filter_measure = IF(ISBLANK(MAX('Table'[Update]))||(MAX('Table'[Update]) <= MAX('date'[Date])),1,0)

 

 

Vlianlmsft_0-1637825608309.png

Then create a measure to count the status:

 

 

Measure 2 = COUNTROWS(FILTER('Table','Table'[Status] = CALCULATE(FIRSTNONBLANK('Table'[Status],0),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[Update]<=MAX('date'[Date])))))

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi ,

 

 

A disconnected calendar is required.

You could create a measure like below and apply it to visual level filter.

 

 

filter_measure = IF(ISBLANK(MAX('Table'[Update]))||(MAX('Table'[Update]) <= MAX('date'[Date])),1,0)

 

 

Vlianlmsft_0-1637825608309.png

Then create a measure to count the status:

 

 

Measure 2 = COUNTROWS(FILTER('Table','Table'[Status] = CALCULATE(FIRSTNONBLANK('Table'[Status],0),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[Update]<=MAX('date'[Date])))))

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , You  use time intelligence with help from date table, dates and period should be used from date table

 

QTD = CALCULATE(Max(Table[Status]),DATESQTD(('Date'[Date])))
Last QTD = CALCULATE(Max(Table[Status]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.