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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

how to create a measure to report a certain value filtered

I need to create an object to report the year I have filtered, but not how to do this by the language fit DAX used by Power BI and even if it is possible to do this.

 

For example, a card-type object displaying the filtered year at that time

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Assuming you have a column called "Year" that has the years, add that as a slicer.

 

Create a measure with the following formula:

 

CurrentYear = MIN([Year])

Add that measure in a card visualization.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Sean
Community Champion
Community Champion

@Anonymous you actually wanted to display the filter Year itself okay

but that will only work with 1 year at a time

 

only way I think you can do this with text filters is with the function VALUES( )

 

Current Text Filter = VALUES([Text Column Filter])

 

AGAIN just as with the year this will only work for 1 filter at a time!

 

This is what I mean (you've selected more years but card only shows 1)

CY Card.png

 

View solution in original post

6 REPLIES 6
Sean
Community Champion
Community Champion

@Anonymous you are implying you will use a slicer (or another visualization) to filter the Year

 

if so there's no need to change the measure or inlcude the filter in the measure

 

When you select a Year in the Slicer - the Card will only show that Year's total - if no Year is Selected - total for all years

Slicer.png

 

Let me know if this helps!

Greg_Deckler
Super User
Super User

Assuming you have a column called "Year" that has the years, add that as a slicer.

 

Create a measure with the following formula:

 

CurrentYear = MIN([Year])

Add that measure in a card visualization.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler

 

The Min function serves as the data type is a number but and when a text, varchar for example?

If this is single select only  Try These: 

 

Displayed Text With Year  = IF ( ISFILTERED(<Year Table - Column>, CONCATENATE("Report Page is Filtered for Year Value of ", (IF(HASONEVALUE(<Year Table - Column>), FIRSTNONBLANK(<Year Table - Column>,"") ,""))), "Report Page is not Filtered by Year")

 

 

Alternative  simple one without Text Concatenation: 

 

Year Selected = IF(HASONEVALUE(<Year Table - Column>), FIRSTNONBLANK(<Year Table - Column>,"") ,"")

 

 

 

Sean
Community Champion
Community Champion

@Anonymous you actually wanted to display the filter Year itself okay

but that will only work with 1 year at a time

 

only way I think you can do this with text filters is with the function VALUES( )

 

Current Text Filter = VALUES([Text Column Filter])

 

AGAIN just as with the year this will only work for 1 filter at a time!

 

This is what I mean (you've selected more years but card only shows 1)

CY Card.png

 

Sean
Community Champion
Community Champion

@Anonymous If you want add this to your Measure (came across to it today)

 

Current Text Filter = IF ( HASONEVALUE(TableName[Column Name]), VALUES(TableName[Column Name], "Multiple Selections")

 

Look at the picture

 

Show Text Filter VALUES.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.