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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DataNinja777
Super User
Super User

Cubeset with the condition of non-blank, nonempty

Hello,

 

I am using Excel for monthly reporting and I'd like to write a cubeset formula which only returns non-empty result.  Please could you let me konw how I can modify the Excel formula below? 

 

DataNinja777_0-1706252361936.png

Thank you!  

2 ACCEPTED SOLUTIONS

Thank you @AmiraBedh for taking time to answer my question.  The issue was fixed by selecting the sort order key "4" instead of "6". Whatever "Alpha descending" means, it got rid of the blank value at the top.  

DataNinja777_0-1706269700159.png

 

View solution in original post

Anonymous
Not applicable

Hi @DataNinja777 ,

1. Identify the CubeSet Formula: Locate your current CubeSet formula which is returning both empty and non-empty results. The formula usually looks like this:

 =CUBESET("connection", "set_expression", "caption", [sort_order], [sort_by])

2. Modify Set Expression for Non-Empty Results: Adjust the "set_expression" part of your CubeSet function to include a filter that excludes empty values. This can often be done by using the `NON EMPTY` keyword within the set expression. For example:

 =CUBESET("connection", "NON EMPTY set_expression", "caption", [sort_order], [sort_by])

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @DataNinja777 ,

1. Identify the CubeSet Formula: Locate your current CubeSet formula which is returning both empty and non-empty results. The formula usually looks like this:

 =CUBESET("connection", "set_expression", "caption", [sort_order], [sort_by])

2. Modify Set Expression for Non-Empty Results: Adjust the "set_expression" part of your CubeSet function to include a filter that excludes empty values. This can often be done by using the `NON EMPTY` keyword within the set expression. For example:

 =CUBESET("connection", "NON EMPTY set_expression", "caption", [sort_order], [sort_by])

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AmiraBedh
Super User
Super User

Try the following : 

 

=IF(CUBESETCOUNT(CUBESET("ThisWorkbookDataModel", "FILTER([Calendar].[yyyy-mm].[All].children, NOT ISEMPTY([Measure].CurrentMember))", "yyyy/mm", 6, "[Calendar].[yyyy-mm]")) > 0, CUBESET("ThisWorkbookDataModel", "FILTER([Calendar].[yyyy-mm].[All].children, NOT ISEMPTY([Measure].CurrentMember))", "yyyy/mm", 6, "[Calendar].[yyyy-mm]"), "No non-empty data")

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you @AmiraBedh for taking time to answer my question.  The issue was fixed by selecting the sort order key "4" instead of "6". Whatever "Alpha descending" means, it got rid of the blank value at the top.  

DataNinja777_0-1706269700159.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.