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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
Most Valuable Professional
Most Valuable Professional

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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