Forum Discussion
Dynamic What If Paramter
Jayaselvan ,You can not use slicer value in calculated table or column .
Try like
Qty_City_A = GENERATESERIES(0, Max(CityQty[Qty]) , 1 )
- Jayaselvan4 years agoHelper II
Thanks for the point out. Actually I have used the single value measure only. There is typo in measure formula, I have rectified the same in query as well.
Measure:
CityAQty =
var _qty = ROUND(CALCULATE(SUMX(FILTER(CityQty, CityQty[City]="A"), CityQty[Qty])),0)
return
IF(DISTNICTCOUNT(CityQty[BranchType]) > 0, _qty,0)
CityAQty is a single value as I have used SUMX.
- amitchandak4 years agoSuper User
Jayaselvan , In generateseries if execute at grand total level, no row context unless you force one. Also no slicer filter will be use
example
Measure:
CityAQty =
var _qty = ROUND(CALCULATE(SUMX(FILTER(CityQty, CityQty[City]="A"), CityQty[Qty])),0)
return
maxx(values(CityQty[City]), calculate( IF(DISTNICTCOUNT(CityQty[BranchType]) > 0, _qty,0) )
- Jayaselvan4 years agoHelper II
Thanks for your response.
To clarify, Change in filter doesn't impact the What If Parameter Upper bound right?
I have tried the code you have suggested which I mention below. The output of CityAQty is same if I view in the card with previos code I have used.
The Sum of total Quantity without filter is 250K. That's what taken as upper bound in What If paramter.
But I need upper bound filter only for City A which is 18K. Is there is any way to achieve this.
Measure:
CityAQty =
var _qty = ROUND(CALCULATE(SUMX(FILTER(CityQty, CityQty[City]="A"), CityQty[Qty])),0)
return
maxx(values(CityQty[City]), calculate( IF(DISTNICTCOUNT(CityQty[BranchType]) > 0, _qty,0) )