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
kalpesh07
Frequent Visitor

Cubeset with multiple Period range?

Hey All! need help with creating a Cubeset formula! I've market data at region level for multiple period & brand! I want to know the rank of particular Brand in each region on Specific Period. Formula is working for a particular period but not working on a range! How can I use a range/dynamic period in cubeset.

=CUBESET(
    "ThisWorkbookDataModel",
    "EXISTS([Brandmaster].[Brand].children, 
    ([State_Master].[State].[Maharashtra], 
    {[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]}))",
    "Set",
    2,
    "{([Measures].[S_Value],[State_Master].[State].[Maharashtra],{[Calendar].[Month].[Oct-2024]})}"
)

This is working for particular month but when I want to get data for 3 month like Oct-Dec

 

=CUBESET(
    "ThisWorkbookDataModel",
    "EXISTS([Brandmaster].[Brand].children, 
    ([State_Master].[State].[Maharashtra], 
    {[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]}))",
    "Set",
    2,
    "{([Measures].[S_Value],[State_Master].[State].[Maharashtra],
{[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[dec-2024]})}"
)

 

I'm getting error on this. Range is working on set expression but while using same in Sort By (Highlighted Part), I'm getting the error.

One way around is passing Each Month separately not tried that but I want it to be dynamic using timeline & using Min/Max function to define the range, it could be 2month or 12 month.

Pls help me with this.

 

Thanks

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@kalpesh07 , Try using

=CUBESET(
"ThisWorkbookDataModel",
"EXISTS([Brandmaster].[Brand].children,
([State_Master].[State].[Maharashtra],
{[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]}))",
"Set",
2,
"AGGREGATE({([Measures].[S_Value],[State_Master].[State].[Maharashtra],{[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]})}, SUM)"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

6 REPLIES 6
v-menakakota
Community Support
Community Support

Hi @kalpesh07 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Hi @kalpesh07 ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you.

v-menakakota
Community Support
Community Support

Hi @kalpesh07 ,

Thank you for helpful response @bhanu_gautam ,I wanted to check if you had the opportunity to review the information provided by bhanu_gautam 
. Please feel free to contact us if you have any further questions. If this answers your question, please Accept it as a solution so other members can easily find it.

Regards,
Menaka.

bhanu_gautam
Super User
Super User

@kalpesh07 , Try using

=CUBESET(
"ThisWorkbookDataModel",
"EXISTS([Brandmaster].[Brand].children,
([State_Master].[State].[Maharashtra],
{[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]}))",
"Set",
2,
"AGGREGATE({([Measures].[S_Value],[State_Master].[State].[Maharashtra],{[Calendar].[Month].[Oct-2024]:[Calendar].[Month].[Dec-2024]})}, SUM)"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Getting #N/A error. It is working fine till part one of the formula but after using Aggregate it is showing the error.

Hi @kalpesh07 ,

In this forum you will find people who are good at Fabric and Power BI if you believe your query can be resolved by people who are good at Excel and who have experience using powerquery within Excel, you can utilize Excel community: Welcome to the Excel Community | Microsoft Community Hub 


Thanks and Regards

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.

Top Solution Authors