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
Hi. I have a table variable consisting of
Hi @yasbos ,
Could you provide me with a sample data that maps the structure of your data, I'd like to try it out.
Best regards,
Community Support Team_ Scott Chang
Hi @yasbos ,
I can't understand you clearly, but I made some attempts. The unique value case you are talking about is misplaced measure.
T1 ALL = CALCULATE(SUMX('T1','T1'[value]),ALLSELECTED('T1'[ID]))
VT ALL = CALCULATE(SUMX('VT','VT'[Duration]),ALLSELECTED('VT'[ID]))
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for trying, @Anonymous . I see you created a calculated table. I can't create calculated tables because I aork with an analysis services tabular model. I can't create columns or calculated tables. However, my question is specific to table variables that are created within the measure for use within the measure only. What I'm sayin is that, it seems that allselected does not work on table variables. The code works fine if I doen't use table variables. My question was whether I was not doing it correctly, and if there is a way to be able to use allselected on a table variable. Thanks.
Hi,
I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.
VAR TotalTime =
SUMMARIZE (
ADDCOLUMNS (
SUMMARIZE ( Tbl1, Tbl1[ID], calendar[Date] ),
"Duration",
CALCULATE (
SUM ( Tbl1[duration] ),
t2_Dim[status] <> "Complete",
ALLSELECTED ( calendar )
)
),
Tbl1[ID],
[Duration]
)
Hi. Thanks. Unfirtunately, it is not the calendar that is an issue. The whole measure works fine without a table variable. It's the variable that causes it to malfunction. I don't undredtand why. I didn't break lineage.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 58 | |
| 47 | |
| 40 | |
| 39 | |
| 22 |
| User | Count |
|---|---|
| 175 | |
| 138 | |
| 118 | |
| 80 | |
| 54 |