Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello good ,
I have a little doubt that it is not if it can be done in power bi, I want to create a variable for me to automatically change the column name to EJ. UC [HC+VARIABLE] DATA in order for me to change in function of the period in which this
Medida 13 0-8 = CALCULATE( SUM( 'DATOS UC'[HC202001]);' DATOS UC'[HC202001]=1;' DATOS UC'[HH202001]=1||' DATOS UC'[HH202001]=2||' DATOS UC'[HH202001]=3||' DATOS UC'[HH202001]=4||' DATOS UC'[HH202001]=5||' DATOS UC'[HH202001]=6||' DATOS UC'[HH202001]=7||' DATOS UC'[HH202001]=8)
Thank you so much!!
Hi @Anonymous ,
In fact, it has not been possible so far.
DAX: Refer to column using string or similar
But for your formula you can write simpler.
Medida 13 0-8 =
CALCULATE(
SUM( 'DATOS UC'[HC202001]),
' DATOS UC'[HH202001] >=1 && ' DATOS UC'[HH202001]<=8
)
Or like this:
Medida 13 0-8 =
CALCULATE(
SUM( 'DATOS UC'[HC202001]),
' DATOS UC'[HH202001] in {1, 2, 3, 4, 5, 6, 7, 8}
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 48 | |
| 35 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 134 | |
| 110 | |
| 59 | |
| 39 | |
| 32 |