Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi Experts
I have the following switch formula to pull back the Top 10 Best performing product, but the switch formula keeps on giving me the same result for each product ...... i have check each of the individual measures and they all produce different values (end results)...
can see the error
Top Products Variance Gross Margin / Net Sales =
VAR RankingContext = VALUES('Product'[Category])
VAR ProfitbabilityMeasure = SELECTEDVALUE(ProfitabilityMeasures[MeasureName])
VAR ReportingMeasure = SELECTEDVALUE(Reporting[Reporting])
RETURN
SWITCH(TRUE(),
ProfitbabilityMeasure = "Gross Margin" && ReportingMeasure = "Reported"
, CALCULATE( [GMvPY1% (Reported PY)]
, TOPN(10, ALL('Product'[Category]),[GMvPY1% (Reported PY)])),
ProfitbabilityMeasure = "Gross Margin" && ReportingMeasure = "NOE"
, CALCULATE( [GMvPY4% (NOE @ AOP Rate)]
, TOPN(10, ALL('Product'[Category]),[GMvPY4% (NOE @ AOP Rate)])),
ProfitbabilityMeasure = "Gross Margin"
, CALCULATE( [GMvPY1% (Reported PY)]
, TOPN(10, ALL('Product'[Category]),[GMvPY1% (Reported PY)])),
ProfitbabilityMeasure = "Net Sales" && ReportingMeasure = "Reported"
, CALCULATE( [NSvPY1% (Reported PY)]
, TOPN(10, ALL('Product'[Category]),[NSvPY1% (Reported PY)])),
ProfitbabilityMeasure = "Net Sales" && ReportingMeasure = "NOE"
, CALCULATE( [NSvPY4% (NOE @ AOP Rate)]
, TOPN(10, ALL('Product'[Category]),[NSvPY4% (NOE @ AOP Rate)])),
ProfitbabilityMeasure = "Net Sales"
, CALCULATE( [NSvPY1% (Reported PY)]
, TOPN(10, ALL('Product'[Category]),[NSvPY1% (Reported PY)])),
RankingContext)
Solved! Go to Solution.
Hi @Anonymous,
Can you share the file or a dummy one, please? You can mask the sensitive parts first.
Did you make any selections? And only one selection of the two columns a time?
Best Regards,
Dale
Hi @Anonymous,
Can you share the file or a dummy one, please? You can mask the sensitive parts first.
Did you make any selections? And only one selection of the two columns a time?
Best Regards,
Dale
Morning dale. i haved managed to solve the answer
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 68 | |
| 31 | |
| 27 | |
| 24 |