Forum Discussion
Calculate values in table with slicer input.
Hi and thx for reading this,
I have a problem that i really have no clue on even if its possible to do
(i hope i can explain what i mean)
I have:
A table made with 2 value for the slicer (10 and 20)
An Item table
An Cost table
What i want is that the slicer value should minus the Cost in Item table and i want to be able to see the counts of the new cost result in the Cost table
in the example (green) the slicer has 10 and we have minus all the cost in Item table with 10 and are able to present the count of ech new cost on the Cost table.
i want to be able to see the Cost table and the result when i change the slicer to new values
/Thanks
Hi , Wresen
Here are the steps you can refer to :
This is my test data:
We can create a measure like this:
Count = var _flag = ISFILTERED('Slicer Table'[Value]) var _slicer_value = IF(_flag = TRUE() , MAX('Slicer Table'[Value]) ,0) var _t = ADDCOLUMNS('Item Table' , "minus" , [Cost]-_slicer_value) var _cur_cost = MAX('Cost Table'[Cost]) var _count = FILTER( _t , [minus] = _cur_cost) return COUNTROWS(_count)Then we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
4 Replies
- amitchandak
Super User
Wresen ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Appreciate your Kudos.- Wresen
Post Patron
Hi amitchandak
added a file :
https://drive.google.com/file/d/1kg74uaJxsvoP2TmL0UGcCCraEEql_xNH/view?usp=share_linkI have added a measure called "Newcost" , this is the Cost value - the slicer value.
I want to be able to see the count if each new cost in the cost table(if i could add a relationship with the mesure "Newcost" and the Cost table would give me the resualt i think)
/thanks
- v-yueyunzh-msft
Community Support
Hi , Wresen
Here are the steps you can refer to :
This is my test data:
We can create a measure like this:
Count = var _flag = ISFILTERED('Slicer Table'[Value]) var _slicer_value = IF(_flag = TRUE() , MAX('Slicer Table'[Value]) ,0) var _t = ADDCOLUMNS('Item Table' , "minus" , [Cost]-_slicer_value) var _cur_cost = MAX('Cost Table'[Cost]) var _count = FILTER( _t , [minus] = _cur_cost) return COUNTROWS(_count)Then we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Wresen
Post Patron
Hi v-yueyunzh-msft
That worked excatly as i wanted 🙂
Thanks so much for all the help.