Forum Discussion
nonoFRissy85
3 years agoRegular Visitor
Measure or count in Y Axis
Hi i wanted to put in a bar chart on Y Axis a number of stores on X Axis a number of products and so having the number of stores for each number of products on X Axis i can put my field "...
- 3 years ago
Ah thanks, now I get it. I have a possible way how you could present this in a bar chart (not sure if this is the most optimal method).
- Add a parameter table to your model.
- Place the parameter column on the y-axis. This column refers to the number of different products (1, 2, 3, etc)
- Create a new measure, where you count the number of stores for every number of different products it sells.
Nb of stores = COUNTROWS ( FILTER ( DISTINCT ( 'Table'[Store] ), VAR _store = 'Table'[Store] VAR _product = SELECTEDVALUE ( Parameter[Parameter] ) VAR _products = CALCULATE ( DISTINCTCOUNT ( 'Table'[Product] ), REMOVEFILTERS ( 'Table' ), 'Table'[Store] = _store ) VAR _result = _products = _product RETURN _result ) ) Place the measure on the x-axis and this is your result:
- Add a parameter table to your model.
Barthel
Solution Sage
3 years agoAh thanks, now I get it. I have a possible way how you could present this in a bar chart (not sure if this is the most optimal method).
- Add a parameter table to your model.
- Place the parameter column on the y-axis. This column refers to the number of different products (1, 2, 3, etc)
- Create a new measure, where you count the number of stores for every number of different products it sells.
Nb of stores =
COUNTROWS (
FILTER (
DISTINCT ( 'Table'[Store] ),
VAR _store = 'Table'[Store]
VAR _product =
SELECTEDVALUE ( Parameter[Parameter] )
VAR _products =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Product] ),
REMOVEFILTERS ( 'Table' ),
'Table'[Store] = _store
)
VAR _result = _products = _product
RETURN
_result
)
)
Place the measure on the x-axis and this is your result:
nonoFRissy85
3 years agoRegular Visitor
What looked simple wasn't in the end! i'll try your solution with my datas.
Thanks for your time and help!