Forum Discussion

MikeGanem3's avatar
MikeGanem3
Helper I
1 year ago
Solved

Display "No data found' when visual is empty

How do I Display "No data found' when a  visual is empty?

8 Replies

    • MikeGanem3's avatar
      MikeGanem3
      Helper I

      That is not what I am looking for...

      I need the "No Data Found" if the entire table is empty and only has the header in the first row.

  • v-sgandrathi's avatar
    v-sgandrathi
    Community Support

    Hello MikeGanem3,

    Thanks for reaching out to the Microsoft Fabric Community forum.

    For the query Display No data found when visual is empty, Try this DAX measure given below (change the measure according to your requirement like table name and column name).
    I have Taken sample data and implemented it.

     

    Measure_region = IF(MAX('Sheet1'[Region])=BLANK(),"No data",MAX('sheet1'[Region]))

    Hope my suggestions give you good ideas, if you have any more questions, please feel free to reach out to us.
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best regards,
    Sahasra.

    • MikeGanem3's avatar
      MikeGanem3
      Helper I

      I've tried it but it did not work.

      I created a new excel file with the sheet name Sheet1 and a column name Region with first row as header. I then copied and pasted your code but it did not do anything and the column value still remained blank.

       

      Also, I need the "No Data Found" if the entire table is empty and only has the header in the first row.

      • v-sgandrathi's avatar
        v-sgandrathi
        Community Support

        Hi MikeGanem3,

        Thanks for using Microsoft Fabric Community Forum.

         

        I tested the scenario using sample data and successfully implemented the solution.

        To achieve this, I used Table and Card visuals with the following measures:


        Table visual Measure:

        NoDataNames =
        IF(
            COUNTBLANK('Table'[names]) = COUNTROWS('Table'),
            "No data found",
            SELECTEDVALUE('Table'[names])
        )
         
        Card visual Measure:
        NoDataMessage =
        IF(
            COUNTBLANK('Table'[names]) = COUNTROWS('Table'),
            "No data found",
            ""
        )
         

        Additionally, I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.

         

        If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!

         

        Regards,
        Sahasra.