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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Variable within variable on Dynamic dimensions

 

Hello All, 

Im having a bit of a problem. Im am switching dimension dynamically using "TREATAS" as below screenshot. Everything is working great except in the case where im using a variable within the switch statement. In GPG case total value is correct but dimansions are coming repeated with same value. Do you know what is going on ? 

 

Thank you And kind reagrds to all.

 

 

Oceans88_0-1635243461301.png

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Without any data is difficult to give you the exact answers however, there is one thing that I can tell you that the calculation of variables is done one time and then reused on your code, taking into attention that you are using the var measure_type  in the beginning this values is calculated once and then reused.

 

Try to place the measure_type inside the OPER variable the syntax is the same so you can make a var within a var.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Without any data is difficult to give you the exact answers however, there is one thing that I can tell you that the calculation of variables is done one time and then reused on your code, taking into attention that you are using the var measure_type  in the beginning this values is calculated once and then reused.

 

Try to place the measure_type inside the OPER variable the syntax is the same so you can make a var within a var.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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