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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ADSL
Post Prodigy
Post Prodigy

Hide Column/field of Chart when have no data available

Hi BI Community Team,

 

We want to show the full year by month of report that it's easy to see the progress. But data available is no full year yet, just available a few month as the screenshot below.

 

2023-07-18_22-15-40.png

 

Any suggestion to show only the month that have data available?

 

Thanks and Regards,

4 REPLIES 4
miTutorials
Super User
Super User

Hi @miTutorials,

After checked and follow, it's still not working.

Could you please check my sample file? Here is the sample file: https://drive.google.com/drive/folders/1ekW7WBSa9h9gW2_6SYkVlhS3peeX_3GC?usp=sharing 

nabandla
Helper I
Helper I

By Relationship:

To display only the months for which data is available in Power BI, you can use a combination of techniques such as filtering and dynamic calculations. Here's a step-by-step approach to achieve this:

1. Determine the range of months for which data is available in your dataset.

2. Create a calendar table or use an existing date table in Power BI that includes all the months in the desired range. Ensure that the table has a relationship with your data table based on the month or date column.

3. In the report view, add a visual element (e.g., a table or a slicer) that displays the months from the calendar table.

4. Apply a filter to the visual element to include only the months for which you have data available. This can be done by selecting the "Visual filters" option in the "Format" pane and setting the filter condition to show only non-blank values.

5. Optionally, you can use conditional formatting to highlight or emphasize the months with data, making it easier to track progress.

By following these steps, you can ensure that only the months with available data are displayed in your Power BI report. This approach provides a dynamic view of the data, automatically adjusting as new months with data become available.

Remember to update the calendar table or refresh the data in Power BI as new months' data becomes available to maintain the accurate representation of progress in your report.

or Using 
DAX :

To dynamically show only the months with available data using DAX in Power BI, you can create a calculated table or measure that filters the months based on the presence of data. Here's an example using a calculated table:

1. Create a new calculated table in Power BI Desktop by going to the "Modeling" tab and clicking on "New Table."

2. Use the following DAX formula to create the calculated table:
```dax
AvailableMonths =
VAR MinDate = MIN('YourTable'[DateColumn])
VAR MaxDate = MAX('YourTable'[DateColumn])
RETURN
ADDCOLUMNS(
CALENDAR(MinDate, MaxDate),
"HasData", IF(COUNTROWS(FILTER('YourTable', 'YourTable'[DateColumn] = [Date])) > 0, 1, 0)
)
```
Replace `'YourTable'` with the name of your data table, and `'DateColumn'` with the column that contains the dates.

3. This formula creates a calculated table called "AvailableMonths" that generates a calendar table between the minimum and maximum dates in your data. It adds a column "HasData" that checks if any rows exist in the original table for each date in the calendar table. If data is present, the "HasData" column will be 1; otherwise, it will be 0.

4. In the report view, use the "AvailableMonths" table to display the months. You can add a visual element like a table or slicer based on the "AvailableMonths" table to show only the months with available data.

By creating a calculated table using this approach, you can dynamically display only the months with data available, ensuring that your report reflects the progress based on the available data.

Hi @nabandla ,

Thank you for your value feedback.

 

But I have tried as your mention, it's still not working.

Could you please help to see my sample file? 

 

Sample file: https://drive.google.com/drive/folders/1ekW7WBSa9h9gW2_6SYkVlhS3peeX_3GC?usp=sharing 

 

Thanks and Regards,

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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