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

Filtre a Visual using a measure

Greeting Members , 

 

im trying to add a filter to my visual where i can filter on current month or more ! 

 

any trick i can do that with measure ?? i can do it with created column it's not complicated the problem that my connection to the cube is Live connection .

 

thanks all in advance . 

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

To filter on current month ,you can create a measure"visual control current month" then drag it to visual filter pane ,if your connection to the cube is Live connection .

 

 

 

visual control current month =
VAR currentmonth =
    MONTH ( TODAY () )
VAR date1 =
    MAX ( Table1[Date] )
RETURN
    IF ( MONTH ( date1 ) = currentmonth, 1, 0 )

 

 

 

Then  apply it to visual filter pane as below:
Screenshot 2020-10-29 140601.png

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@Anonymous , for this month you can use time intelligence

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
this month =MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
previous month value = CALCULATE(sum(''Table''[total hours value]),previousmonth('Date'[Date]))

 

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 :radacad sqlbi My Video Series Appreciate your Kudos.

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.