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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX to check if the month filter passed from the matrix visual = current month

 Hi.

I need help with the following scenario please,

I have a matrix visual with month of the fiscal year as columns.I have to write dax for the logic if month in the matrix is current month do calculation1 and for all the past and future months of the year do calculation2. In the example, If the current in feb, for the matrix column Feb,I should display the value of calculation1.For all the other months I should show the value of calculation2. Hope I made th question clear. 

 

Divya_Amar_1-1676499601910.png

 

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Assuming the year and month name have been dragged from the Calendar Table, write this measure

=if(and(today()>=min(calendar[date]),today()<=max(calendar[date])),[measure1],[measure2])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PawelWrona
Resolver II
Resolver II

Do you have these months created as text value? If yes, here is the solution:

PawelWrona_0-1676507850722.png


for you specifically it would be:
IF(SELECTEDVALUE('Table'[Month]) = currentMonth, Calculation1, Calculation2)

Anonymous
Not applicable

Thanks Pawel. Will SELECTEDVALUE apply for filtering through matrix visual column? I thought SELECTEDVALUE can only be used for filters applied through FILTERING Pane.Please correct me if I am wrong.

Yes, it will work to get the current value from column or row level as well. Depends how you use it ;⁠)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors