Forum Discussion
Anonymous
4 years agoNot applicable
New Report
Hello! I started a new job to help with sales using Power BI. Well I'm not a Power BI expert, I know the basics. The problem is that I'm trying to understand how the report was created (the logic b...
- 4 years ago
Hi Anonymous ,
SWITCH function is like a shorthand IF. It is easier to read than having many IF STATEMENTS.Cnpjs IDs/Qty = SWITCH ( SELECTEDVALUE ( Formato[Formato] ), "Qty", [CNPJ compraram com ID], "Volume", [Total_Vol_ID´s] )The above formula tells that if the value selected from Formato column in the Formato table is Qty then it will return the measure [CNPJ compraram com ID] and if volume then [Total_Vol_ID´s]
Total Resellers = SWITCH ( SELECTEDVALUE ( Formato[Formato] ), "Qty", DISTINCTCOUNT ( ChannelDnaReport[POSSoldToCustomerTaxIdRoot] ), "Volume", SUM ( ChannelDnaReport[SellThruProductUnits] ) )The above formula is very similar to the previous one except that instead of refrencing a measure when a value is selected from Formato[Formato], an aggregate expression is used - DISTINCTCOUNT(ChannelDnaReport[POSSoldToCustomerTaxIdRoot]) or SUM(ChannelDnaReport[SellThruProductUnits])
Both formulas will return blank/null if no value is selected from Formato[Formato] unless another condition is added to them to return otherwise.
Anonymous
4 years agoNot applicable