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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
aamirkhan_WT
Helper II
Helper II

Dynamic Title not working if there is no value then show |"No Data" if there is value then "Data"

Hi All

 

Dynamic Title not working if there is no value then show |"No Data" if there is value then "Data" basde on measure I have created
Dynamic tiltel 

HasData =
IF(
    ISBLANK([Q2]) ,
    "No Data Available: Would you be open to a full-time, online education for your child?",
    "Would you be open to a full-time, online education for your child?"
)


There is dax based on that it will show title 

Q2 =
----------------------------------NA-------------------------------------
VAR selectedFilter = SELECTEDVALUE(DimCountry[ID])

VAR TotalQ2Overall_NA =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "NA" }
    )

VAR TotalQ2PerYearCountry_US =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],DimCountry[Country],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "US" }
    )

VAR _Result_US =
    DIVIDE(TotalQ2PerYearCountry_US,
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year]),
        'CombinedData_23_24_25'[Country] IN { "NA" }
    ),0)


VAR TotalQ2Overall =
    CALCULATE(
        COUNT('CombinedData_23_24_25'[ID]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year])
    )

VAR _Result_NA =
    DIVIDE(TotalQ2Overall_NA,TotalQ2Overall,BLANK())
----------------------------------APAC-------------------------------------
VAR TotalQ2Overall_APAC =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "APAC" }
    )

VAR TotalQ2PerYearCountry_PH =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],DimCountry[Country],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "PH" }
    )

VAR _Result_PH =
    DIVIDE(TotalQ2PerYearCountry_PH,
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year]),
        'CombinedData_23_24_25'[Country] IN { "APAC" }
    ),0)

VAR TotalQ2PerYearCountry_MY =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],DimCountry[Country],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "MY" }
    )
   
VAR _Result_MY =
    DIVIDE(TotalQ2PerYearCountry_MY,
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year]),
        'CombinedData_23_24_25'[Country] IN { "APAC" }
    ),0)

VAR TotalQ2PerYearCountry_ID =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],DimCountry[Country],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "ID" }
    )

VAR _Result_ID =
    DIVIDE(TotalQ2PerYearCountry_ID,
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year]),
        'CombinedData_23_24_25'[Country] IN { "APAC" }
    ),0)


VAR _Result_APAC =
    DIVIDE(TotalQ2Overall_APAC,TotalQ2Overall,0)
----------------------------------Oceania-------------------------------------
VAR TotalQ2Overall_Oceania =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "Oceania" }
    )

VAR TotalQ2PerYearCountry_AU =
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
        ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year],DimCountry[Country],CombinedData_23_24_25[Q2_Purchase Decision]),
        'CombinedData_23_24_25'[Country] IN { "AU" }
    )
VAR _Result_AU =
    DIVIDE(TotalQ2PerYearCountry_AU,
    CALCULATE(
        COUNT(CombinedData_23_24_25[Q2]),
         ALLEXCEPT('CombinedData_23_24_25', 'CombinedData_23_24_25'[Year]),
        'CombinedData_23_24_25'[Country] IN { "Oceania" }
    ),0)


VAR _Result_Oceania =
    DIVIDE(TotalQ2Overall_Oceania,TotalQ2Overall,0)
------------------------------------------------------------------------------
RETURN

SWITCH(

    selectedFilter,
   1, _Result_US,
   2, _Result_NA,
   3, _Result_AU,
   4, _Result_Oceania,
   5, _Result_PH,
   6, _Result_MY,
   7, _Result_ID,
   8, _Result_APAC

    )
1 ACCEPTED SOLUTION

Thanks for the replies from dharmendars007 and elitesmitpatel.

 

Hi @aamirkhan_WT ,

 

Change SELECTVALUE to MAX in the measure you created:

vlinhuizhmsft_0-1728886005566.png

 

The result is as follows:

vlinhuizhmsft_1-1728886134296.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
aamirkhan_WT
Helper II
Helper II

Any update 

aamirkhan_WT
Helper II
Helper II

Here is the file https://drive.google.com/file/d/1R8zvHB3WlEPC8e7VZDzH7d35vovrDlpJ/view?usp=sharing
There are 2 tabs
APAC & NA
NA has data 
APAC has not data

I want dynamuic title if there is Data then it show "Data Existed" and if no data then it will show "No Data"

dharmendars007
Memorable Member
Memorable Member

Hello @aamirkhan_WT , 

 

Its difficult to to check your measure without a sample file however what i can suggest is please ckeck if there is truly no data like if it has soaces or Zero's.

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

elitesmitpatel
Solution Supplier
Solution Supplier

share the dummy pbix file

Here is the file https://drive.google.com/file/d/1R8zvHB3WlEPC8e7VZDzH7d35vovrDlpJ/view?usp=sharing
There are 2 tabs
APAC & NA
NA has data 
APAC has not data

I want dynamuic title if there is Data then it show "Data Existed" and if no data then it will show "No Data"

Thanks for the replies from dharmendars007 and elitesmitpatel.

 

Hi @aamirkhan_WT ,

 

Change SELECTVALUE to MAX in the measure you created:

vlinhuizhmsft_0-1728886005566.png

 

The result is as follows:

vlinhuizhmsft_1-1728886134296.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.