Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
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.
Do you have these months created as text value? If yes, here is the solution:
for you specifically it would be:
IF(SELECTEDVALUE('Table'[Month]) = currentMonth, Calculation1, Calculation2)
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 ;)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!