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
amit_s
Frequent Visitor

Filter out latest date period on a drilldown enabled viz

Hi all,

I couldn't find a comprehensive answer to this question albeit googling quite a bit, so here goes:

 

I have a simple line chart built over the automatic date hierarchy, with the drilldown option enabled.

I would like to filter out from the chart the last incomplete date period, depending on the displayed hierarchy level.

 

For example, when viewing the chart on the daily level, I would like to display data only up to yesterday's date.

For weekly - up to last week. and so on.

 

I know how to do it in Tableau, but Power BI works differently and the pin hadn't completely dropped yet.

 

Ideally, I'd like to learn the answer to the following:

* What is the best practice to filter the last incomplete date? Using a calculated column? A measure?

* What modifications need to be made to allow it to work with a drill-down?

* Assuming both ways are viable (which might be wrong), what are the pros and cons of each way?

* In general, what do I need to take into account when creating a calculation with DAX that is supposed to behave in a certain way when changing levels?

I understand I'm asking for a lot here, I'd greatly appreciate an answer to just the first two bullets.

 

Thank you!

Amit

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @amit_s 
You can manipulate your measure according to the hierarchy level by using the function "isinscope".
in my example I just returned 1,2,3 according to the level of the hierarchy, can you instead of it use your filters?

Ritaf1983_0-1691986161438.png

More information about is in scope here :

https://www.youtube.com/watch?v=DtOfcsS_pQw&t=218s

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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