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! Get ahead of the game and start preparing now! Learn more
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! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 122 | |
| 111 | |
| 83 | |
| 69 | |
| 68 |