How to Display Selected Value from the Slicer in the?Card?

How to Display Selected Value from the Slicer in the?Card?

Are you tired of static text in your Power BI cards? Want to dynamically display values based on slicer selections? Let's dive into a simple yet powerful solution!

Problem: We often need to show selected values from slicers alongside static text in a card visual. For example, displaying "Year is: 2022" when "2022" is selected in the year slicer.

Solution:

  • Create a Measure:Code snippet

Selected_val =

VAR Cond =

IF (

HASONEVALUE ( ‘Date Table'[Year] ),

SELECTEDVALUE ( ‘Date Table'[Year] ),

“”

)

RETURN

CONCATENATE ( “Year is : “, Cond )


  • This measure checks if a single value is selected in the "Year" slicer. If so, it concatenates "Year is: " with the selected year.

Add a Card Visual: Drag and drop the newly created measure onto a card visual.

Result: The card will dynamically display the selected year, updating as the slicer selection changes.

Conclusion: By leveraging DAX and card visuals, you can create dynamic and informative visualizations in Power BI. This technique can be applied to various scenarios, making your reports more interactive and user-friendly.

要查看或添加评论,请登录

Addend Analytics: Microsoft D365 & Data Analytics Partner的更多文章

社区洞察

其他会员也浏览了