The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
Please can someone enlighten me.
Thanks
Solved! Go to Solution.
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.
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.