Forum Discussion
manideep547
Helper III
6 years agoAmount breakdown
Here I have to breakdown the Amount like(AED 0,AED 1-50,AED 51-100, AED 101-200..etc). For example in a slicer, I clicked AED 1-50 .IN card the count should be 4. Table A Id Amo...
- 6 years ago
Hi manideep547,
You can achieve it using a measure:
Measure = VAR __breakdown = SELECTEDVALUE ( Breakdown[Amount breakdown] ) VAR __delimiter_position = FIND ( "-", __breakdown, 1, 0 ) VAR __value_from = VALUE ( LEFT ( __breakdown, __delimiter_position - 1 ) ) VAR __value_to = VALUE ( RIGHT ( __breakdown, LEN ( __breakdown ) - __delimiter_position ) ) VAR __tbl_A = CALCULATE ( COUNTROWS ( 'Table A' ), 'Table A'[Amount] >= __value_from, 'Table A'[Amount] <= __value_to ) VAR __tbl_B = CALCULATE ( COUNTROWS ( 'Table B' ), 'Table B'[Amount] >= __value_from, 'Table B'[Amount] <= __value_to ) VAR __tbl_C = CALCULATE ( COUNTROWS ( 'Table C' ), 'Table C'[Amount] >= __value_from, 'Table C'[Amount] <= __value_to ) VAR __tbl_D = CALCULATE ( COUNTROWS ( 'Table D' ), 'Table D'[Amount] >= __value_from, 'Table D'[Amount] <= __value_to ) RETURN __tbl_A + __tbl_B + __tbl_C + __tbl_DRegards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Anonymous
6 years agoNot applicable
You can achieve this by creating a conditional column.
To do this Go to Edit Queries, Add Column, Conditional column
then set up as follows
If Amount > 0 and < 50 then '1-50'
then carry on as required...
Hope this helps.