Thursday, April 23, 2020

Create Dynamic Header in power bi

How to create a dynamic header?

Let suppose table contains the product category and product sub category. Then header only to show the product category which is filtered.

This can be achieved by card visual and DAX expression.



Step1: Create new measure.

Step2: Write DAX expression like below.

header =
CALCULATE (
    IF (
        ISFILTERED ( DimProductCategory[EnglishProductCategoryName] ),
        "Results for Product Category name   "
            CONCATENATEX (
                VALUES ( DimProductCategory[EnglishProductCategoryName] ),
                ( DimProductCategory[EnglishProductCategoryName] ),
                "|"
            ),
        "Showing results for all Categories"
    )
)

Step3: Take card visual and add this measure  

No comments:

Post a Comment

Sort by Month and year in the table

  Solved: Sort by month in Power BI - Microsoft Power BI Community