Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am in need to get the selected value from the slicer which is showing Month Year. I am acheiving this by creating a measure and using selectedValue(). I am not sure what is the datatype of this measure.
My issue is i need to compare this value with a date field and create a new column if the data matches. I have tried all the options but somehow the comaprison is alwyas resulting in a no.
I created a column and then formateed the date field as Month and year and then compared with the selected value field but it doesnt work.
Can anyone suggest how to achieve this.
I tried it but Somehow the Caclculate is not working. Here is what i tried..
CALCULATE(COUNTROWS(vwSafetyContacts),FILTER(vwSafetyContacts,FORMAT(vwSafetyContacts[Submitted],"mmm-yyyy") = vwSafetyContacts[Sel Value]))
I do not have any other measure in my table to sum .. The problem I am seeing in the comaprison is that it works for some rows and not for other.
Hi @Rk_1411 ,
In order to provide you a suitable solution, could you please share some sample data in your table vwSafetyContacts (exclude sensitive data) with Text format and your expected result with backend logic and special examples. By the way, [Sel Value] is a measure or a fact field in the table? If it is a measure, please provide its formula. It is better if you can share a simplified pbix file. Thank you.
How to upload PBI in Community
Best Regards
@Rk_1411 , You can create month year in date table
Month Year = FORMAT([Date],"mmm-yyyy")
Month Year sort = FORMAT([Date],"yyyymm")
and use that
then this should work
new measure =
calculate( sum(Table[Value]), filter('Table', 'Table'[Month Year] = selectedvalue(Month Year)))
or
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = mainx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |