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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

v-binbinyu-msft
Community Support
Community Support

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
v-binbinyu-msft
Community Support
Community Support

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
Resident Rockstar
Resident Rockstar

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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