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
Anonymous
Not applicable

Hiding future dates with no values when using drill down

Hello Community  -  I am using the measure below for YTD which I like because it hides future dates that have no values when putting in a column chart.   Like below.  

 

The problem comes when I try to drill down to the month level  (from the "date" level).   At the Date level, the visual displays as it should.   But at the month level, it does not hide future dates...it just repeats the current YTD value for each of the future months as you see in the 2nd visual. 

 

Any way to modify this formula so the month level view also hides the future months?

 

Cumulative Orders 2 =
VAR LastOrderDate = CALCULATE(LASTDATE('Orders 2'[Order Date]),ALL('Orders 2'))

RETURN
IF(SELECTEDVALUE('Date Table'[Date]) > LastOrderDate, BLANK(),
CALCULATE([YTD Sum of Orders 2],FILTER(ALLSELECTED('Date Table'),'Date Table'[Date] <= MAX('Date Table'[Date]))))

 

view based on the Date value on the x axis  from my date table

texmexdragon_0-1613748073369.png

 

Does not hide future months if I drill down to Month (from my date table)

 

texmexdragon_1-1613748128119.png

 

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Anonymous there is a workaround for it

in your date table, create one more custom column like below

 
is before today = IF(sle[Date]<=TODAY(),TRUE(),FALSE())
 
 
negi007_1-1613750115008.png

 

then you can use this new column as a filter, in your chart. all dates before today will always be true.

 

negi007_2-1613750185800.png

 

 

for more details, please refer to below blog

https://blog.enterprisedna.co/show-results-up-to-current-date-or-a-specific-date-in-power-bi/

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
negi007
Community Champion
Community Champion

@Anonymous there is a workaround for it

in your date table, create one more custom column like below

 
is before today = IF(sle[Date]<=TODAY(),TRUE(),FALSE())
 
 
negi007_1-1613750115008.png

 

then you can use this new column as a filter, in your chart. all dates before today will always be true.

 

negi007_2-1613750185800.png

 

 

for more details, please refer to below blog

https://blog.enterprisedna.co/show-results-up-to-current-date-or-a-specific-date-in-power-bi/

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@Anonymous , Try like

 

Cumulative Orders 2 =
VAR LastOrderDate = maxx(allselected('Orders 2'),'Orders 2'[Order Date])

RETURN
IF(max('Date Table'[Date]) > LastOrderDate, BLANK(),
CALCULATE([YTD Sum of Orders 2],FILTER(ALLSELECTED('Date Table'),'Date Table'[Date] <= MAX('Date Table'[Date]))))

Anonymous
Not applicable

@amitchandak 
That basically worked except for when I drill down from Date to Month...it only shows the month of January...and should be showing Jan and Feb.    When I drill down from the month, it properly shows the weeks.   But it's odd that the Feb month is missing when I drill to the Month level?   

 

texmexdragon_0-1613750089045.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.