Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Thanks to @Anonymous and @bhanu_gautam I finally got that working :
SUMMARIZECOLUMNS (
'TABLE 1'[Dim1], [...]
'TABLE 1'[Dim2],
'TABLE 1'[Dim3],
"Measure1 t1", CALCULATE ( SUM ( 'TABLE 1'[Measure1] ), 'TABLE 1'[Date] = "t1" ),
"Measure 2 t1", CALCULATE ( SUM ( 'TABLE 1'[Measure2] ), 'TABLE 1'[Date] = "t1" ),
"Measure1 t2", CALCULATE ( SUM ( 'TABLE 1'[Measure1] ), 'TABLE 1'[Date] = "t2" ),
"Measure 2 t2", CALCULATE ( SUM ( 'TABLE 1'[Measure2] ), 'TABLE 1'[Date] = "t2" )
)
Now, I'd like to to return difference between Measure1 at t2 - t1 ?
What is the syntax to call something like (adding the following line to the query above doesn't work):
DeltaT2T1 = [Measure1 t2] - [Measure1 t1]
Should I do something like :
VAR Measure1 t1 = CALCULATE ( SUM ( 'TABLE 1'[Measure1] ), 'TABLE 1'[Date] = "t1" ),
VAR Measure1 t2" = CALCULATE ( SUM ( 'TABLE 1'[Measure1] ), 'TABLE 1'[Date] = "t2" ),
SUMMARIZECOLUMNS (
'TABLE 1'[Dim1], [...]
"Measure1 t1", [Measure1 t1],
"Measure1 t2", [Measure1 t2],
"Delta", [Measure1 t2] - [Measure1 t1]
)
or is there another / better way ?
I voted mysel a RTFM : "Columns in table variables cannot be referenced via TableName[ColumnName] syntax"
So what I wanted to do just can't be done.
The idea I had with measure would probably do the trick... but thoses measures can't use outside VAR which would be the case in my problem.
I guess I have to find another way
Good job @puserp
Proud to be a Super User! |
|
Thanks 😉 , I still have a new question in this post 😉
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 22 | |
| 12 | |
| 10 | |
| 10 | |
| 9 |