The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
// Not sure if I've got the logic right as I can't see
// the model. Also, not sure if all the language
// constructs will work in the DQ mode.
[Base Value] = SUM( 'Table'[Value] )
[Value Converted] =
VAR SelectedCurrency =
// This line says: if there is only one visible Code
// in the current context, take it. Otherwise use "USD".
COALESCE( SELECTEDVALUE( Results_ExchangeRates[Code] ), "USD" )
// This will return the rate if there's only one visible
// in the current context. If none is visible or many, BLANK
// will be returned.
VAR SelectedRate = SELECTEDVALUE( Results_ExchangeRates[Rate] )
VAR EffectiveRate =
// For code = "USD", return rate = 1, else take
// the rate from above.
IF( SelectedCurrency = "USD", 1, SelectedRate )
VAR Result = [Base Value] * EffectiveRate
RETURN
Result
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |