Forum Discussion
Anonymous
6 years agoNot applicable
Filtering a cloumn with text
Hi Pleas can someone help with this. I have searched and cant find the answer to my question(s). How to filter a column with text only without using the page or visual filters. I am crea...
- 6 years ago
Anonymous ,
since you have provided very little information about your model and data, this is a bit of guess work. Are you sure you can't handle fees within a calculated column, like this:
sales fee = VAR _sumFees = transactions[total order value] * LOOKUPVALUE ( dimFees[base transaction fee]; dimFees[source]; transactions[source] ) + transactions[total order value] * LOOKUPVALUE ( dimFees[percentage of total order]; dimFees[source]; transactions[source] ) VAR _minFee = LOOKUPVALUE ( dimFees[minimum value]; dimFees[source]; transactions[source] ) RETURN IF ( _sumFees > _minFee; _sumFees; _minFee )if you need it as a measure you should look into the sumx-function
Measure = SUMX ( VALUES ( transactions[transactionID] ); VAR _source = SELECTEDVALUE ( transactions[source] ) VAR _minFee = LOOKUPVALUE ( dimFees[minimum value]; dimFees[source]; _source ) VAR _baseFeePrTrans = LOOKUPVALUE ( dimFees[base transaction fee]; dimFees[source]; _source ) VAR _totalFee = LOOKUPVALUE ( dimFees[percentage of total order]; dimFees[source]; _source ) RETURN IF ( CALCULATE ( SUM ( transactions[total order value] ) ) * _totalFee + CALCULATE ( COUNT ( transactions[transactionID] ) ) * _baseFeePrTrans < _minFee; _minFee; CALCULATE ( SUM ( transactions[total order value] ) ) * _totalFee + CALCULATE ( COUNT ( transactions[transactionID] ) ) * _baseFeePrTrans ) )Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
sturlaws
Resident Rockstar
6 years agoAnonymous ,
since you have provided very little information about your model and data, this is a bit of guess work. Are you sure you can't handle fees within a calculated column, like this:
sales fee =
VAR _sumFees =
transactions[total order value]
* LOOKUPVALUE (
dimFees[base transaction fee];
dimFees[source]; transactions[source]
)
+ transactions[total order value]
* LOOKUPVALUE (
dimFees[percentage of total order];
dimFees[source]; transactions[source]
)
VAR _minFee =
LOOKUPVALUE ( dimFees[minimum value]; dimFees[source]; transactions[source] )
RETURN
IF ( _sumFees > _minFee; _sumFees; _minFee )
if you need it as a measure you should look into the sumx-function
Measure =
SUMX (
VALUES ( transactions[transactionID] );
VAR _source =
SELECTEDVALUE ( transactions[source] )
VAR _minFee =
LOOKUPVALUE ( dimFees[minimum value]; dimFees[source]; _source )
VAR _baseFeePrTrans =
LOOKUPVALUE ( dimFees[base transaction fee]; dimFees[source]; _source )
VAR _totalFee =
LOOKUPVALUE ( dimFees[percentage of total order]; dimFees[source]; _source )
RETURN
IF (
CALCULATE ( SUM ( transactions[total order value] ) ) * _totalFee
+ CALCULATE ( COUNT ( transactions[transactionID] ) ) * _baseFeePrTrans < _minFee;
_minFee;
CALCULATE ( SUM ( transactions[total order value] ) ) * _totalFee
+ CALCULATE ( COUNT ( transactions[transactionID] ) ) * _baseFeePrTrans
)
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.