Forum Discussion
How to make my Table 1 display 11 Brands ?
Hi All
Anonymous have help me on below post :-
I try to follow his instruction and create Table 2.
Table 1 Report is i just place below field name to striaght table :-
BRAND_c
sales
Below Table 1 is correct as it display 11 Brands.
Below Table 2 Report
My question is how to make both table similar display full list of brand ?
Some thing wrong with my expression on _amount_select
Below is my PBI sample file :-
https://www.dropbox.com/s/3h1tot6rt2wiwua/Flexy%20Dimension%20V005.pbix?dl=0
Paul
admin11 , Both are measures used in the table. Seem like you want to change Axis/Group by. That is possible using bookmark or Unpivot data. Not using measure
Dynamically change chart axis in Power BI
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/Hi, admin11 ;
Please try it.
_amount_select = SWITCH( SELECTEDVALUE(SliceTable[Slice]), "BRAND_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('summrizeTable1'[sum]),FILTER(ALL('summrizeTable1'),'summrizeTable1'[BRAND_C]=MAX('summrizeTable1'[BRAND_C]))), SUM('SALES'[sales])), "SEGMENT_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('summrizetable2'[sum]),FILTER(ALL('summrizetable2'),'summrizetable2'[SEGMENT_C]=MAX('summrizetable2'[SEGMENT_C]))), SUM('SALES'[sales])))The final output is shown below:
Or:
_amount_select2 = SWITCH( SELECTEDVALUE(SliceTable[Slice]), "BRAND_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('SALES'[sales]),FILTER(ALLSELECTED('SALES'),[BRAND_C]=MAX('summrizeTable1'[BRAND_C]))), SUM('SALES'[sales])), "SEGMENT_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('SALES'[sales]),FILTER(ALLSELECTED('SEGMENT'),[SEGMENT_C]=MAX('summrizetable2'[SEGMENT_C]))), SUM('SALES'[sales])))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
11 Replies
- amitchandak
Super User
admin11 , There is nothing in lese where brand <> BRAND_C
I added else for testing
_amount_select =
var _select=SELECTEDVALUE(SliceTable[Slice])
return
SWITCH(
TRUE(),
_select="BRAND_C", CALCULATE(SUM('SALES'[sales]),FILTER(ALL('SALES'),'SALES'[BRAND_C]=MAX('SALES'[BRAND_C]))),
SUM('SALES'[sales])
)- admin11
Memorable Member
- amitchandak
Super User
admin11 , Both are measures used in the table. Seem like you want to change Axis/Group by. That is possible using bookmark or Unpivot data. Not using measure
Dynamically change chart axis in Power BI
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/
- v-yalanwu-msft
Community Support
Hi, admin11 ;
I tested it and which return the correct result.
1.when i select BRAND_C.
2.when I select the SEGMENT_C.
If you want to show 11 brands ,you must have rank column (who more), and it will ok.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- admin11
Memorable Member
Thank you very much for your help. I will rest it out
- v-yalanwu-msft
Community Support
Hi, admin11 ;
Please try it.
_amount_select = SWITCH( SELECTEDVALUE(SliceTable[Slice]), "BRAND_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('summrizeTable1'[sum]),FILTER(ALL('summrizeTable1'),'summrizeTable1'[BRAND_C]=MAX('summrizeTable1'[BRAND_C]))), SUM('SALES'[sales])), "SEGMENT_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('summrizetable2'[sum]),FILTER(ALL('summrizetable2'),'summrizetable2'[SEGMENT_C]=MAX('summrizetable2'[SEGMENT_C]))), SUM('SALES'[sales])))The final output is shown below:
Or:
_amount_select2 = SWITCH( SELECTEDVALUE(SliceTable[Slice]), "BRAND_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('SALES'[sales]),FILTER(ALLSELECTED('SALES'),[BRAND_C]=MAX('summrizeTable1'[BRAND_C]))), SUM('SALES'[sales])), "SEGMENT_C",IF(ISINSCOPE(summrizetable2[rank]), CALCULATE(SUM('SALES'[sales]),FILTER(ALLSELECTED('SEGMENT'),[SEGMENT_C]=MAX('summrizetable2'[SEGMENT_C]))), SUM('SALES'[sales])))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- admin11
Memorable Member
I just notice that the total amount wrong. it is possible to make Table 1 and Table 2 both same value ?
- v-yalanwu-msft
Community Support
- admin11
Memorable Member
Yes , thank you very much for your help