The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

FINAL PROJECT -TASK 6-POWER BI

FINAL PROJECT -TASK 6-POWER BI

0
Votes
1
Answer

When we are creating the dynamic measures for SalesAmountSelectedCurrency , we have used different variables for each currency and returned them through IF statements as seen in the following code:
SalesAmountSelectedCurrency =
var SalesAmount = SUm(fact_InternetSales[SalesAmount])
var USDdollor = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”USD”)
var AUD = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”AUD”)
var CAD = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”CAD”)
var DEM = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”DEM”)
var FRF = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”FRF”)
var GBP = CALCULATE(SalesAmount,dim_Currency[CurrencyAlternateKey]=”GBP”)
RETURN
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”USD”,USDdollor,
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”AUD”,AUD,
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”CAD”,CAD,
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”DEM”,DEM,
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”FRF”,FRF,
IF(SELECTEDVALUE(dim_Currency[CurrencyAlternateKey])=”GBP”,GBP,
“No Currency Selected “))))))
But when we have created the dynamic measure for title bar , it is seen that only a single variable using ISFILTERED and VALUES is written as follows :
Titlebar =
var CurrencySelected =
IF(ISFILTERED(dim_Currency[CurrencyAlternateKey]),VALUES(dim_Currency[CurrencyAlternateKey]),BLANK())
RETURN
IF(ISFILTERED(dim_Currency[CurrencyAlternateKey]),”Sales Amount in ” & CurrencySelected & ” vs ALL currencies “,”Please select a currency”)
Thus , Can you explain the usage / working of ISFILTERED and VALUES in detail , what it returns , what it checks for ?

1 Answer

365 Team
0
Votes

ISFILTERED returns a boolean expression if the slicer has been filtered, so if if the Currency Key is filtered, then show me the values. VALUES returns distinct values so in our case returns the selected value.