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

Month Filter greater than today blank

Hi,

 

I have this filter that takes out the dates past today, but I cant get it to do at the the month level.

 

Sold Units, Cumulative =

IF(SELECTEDVALUE(Dates[Date])>TODAY(), blank(),
Calculate( [Sold Units],
filter(ALLSELECTED(Dates),
        Dates[Date] <= MAX(Dates[Date]))))
 
How do I make this filter make months forward blank? Like the date one.
 
Thanks!
Date.pngMonth.png
 
4 REPLIES 4
danextian
Super User
Super User

Hi @Anonymous 

You want this line hidden?

danextian_0-1661384657412.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I used a dummy data with a similar data model as yours (probably) and the measure below works fine

YTD2 =
IF (
    MAX ( Dates[Date] ) <= TODAY (),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLSELECTED ( Dates[Date] ), Dates[Date] <= MAX ( 'Dates'[Date] ) )
    )
)

danextian_1-1661384921268.png

Here's a sample pbix

https://drive.google.com/file/d/1DdI_SAgjNwchVCdIevXvGmhLfVwn6i5V/view?usp=sharing 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian

 

Thanks for the help. I tried that formula and it looks like it is pulling all the units? Not sure. I have a measure in Calculate instead of a sum of a column though.

 

Thanks!

 

TrevorMonths.png

 

 

Sold Units, Cumulative =

IF (
    MAX ( Dates[Date] ) <= TODAY (),
    CALCULATE ([Sold Units]
        ,
        FILTER ( ALLSELECTED ( Dates[Date] ), Dates[Date] <= MAX ( 'Dates'[Date] ) )
    )
)

What do you mean by "it is pulling all the units"? Can you please share a sanitzed pbix of your data model?










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.