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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Create Table from SUM of values from other tables


I have created measures called prev1, prev2, cur1, cur2 which are sum of numbers.
Then I created a table called using "Enter Data" button.
In the first column I have entered Item_A, Item_B

I am trying to acheive the below:


Col1 PREV CUR
------ ---- -----
Item_A Prev1 Cur1
Item_B Prev2 Cur2


E.g.:
Col1 PREV CUR
------ ---- -----
Item_A 123 312
Item_B 213 132


I tried the below but it give me a very large number.


PREV = SWITCH([Col1], Item_A", [Prev1])

Also tried this but its the same large number even when I try with CALCULATE
PREV = sumx(FooBar, [Prev1])

 

This may be becasue I have slicers and it ignores the filter context from those slicers. So I have tried ALLSELECTED() but it does not change the figures on a measure:

CALCULATE(sum(Cur1), ALLSELECTED())


Please can someone enlighten me.


Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have finally got the this:

 

calculate(SUM(cur), filter(myTable, dateID = related(dateID)))

 

So, I am making sure that the value is calculated by complying to the relationship between the two tables. This way I am making sure that FILTER CONTEXT is intact.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I have finally got the this:

 

calculate(SUM(cur), filter(myTable, dateID = related(dateID)))

 

So, I am making sure that the value is calculated by complying to the relationship between the two tables. This way I am making sure that FILTER CONTEXT is intact.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors