Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Genius ,
Question:
if dont choose any option from my slicer. i have set my default currency value as EURO but its showing USD vale is my default.
My table :
currency_id Currency
1 USD
2 EURO
3 Aop Comparable
my measure code is :
Selected Currency = MIN('Currency Table'[currency_id])
selection currency = IF (HASONEVALUE('Currency Table'[Currency]),VALUES('Currency Table'[Currency]))
SalesTo Thirds = switch([selected currency],1,calculate([CYACTUALUSDSCALEPERIOD],filter(vPMA_NAM_SalesReport,vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7]="Sales to Thirds"))
,2,calculate([CYACTUALEURSCALEPERIOD],filter(vPMA_NAM_SalesReport,vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7]="Sales to Thirds"))
,3,calculate([CYACTUALAOPCOMPARABLESCALEPERIOD],filter(vPMA_NAM_SalesReport,vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7]="Sales to Thirds"))
,calculate([CYACTUALEURSCALEPERIOD],filter(vPMA_NAM_SalesReport,vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7]="Sales to Thirds"))
)
Solved! Go to Solution.
The measure below in your case would return 1(USD) when no currency selected.
Selected Currency = MIN('Currency Table'[currency_id])
Which means, the SWTICH would always go to option 1 if no selection on the slicer.
SalesTo Thirds = SWITCH ( [selected currency], 1, CALCULATE ( [CYACTUALUSDSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), 2, CALCULATE ( [CYACTUALEURSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), 3, CALCULATE ( [CYACTUALAOPCOMPARABLESCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), CALCULATE ( [CYACTUALEURSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ) )
The measure below in your case would return 1(USD) when no currency selected.
Selected Currency = MIN('Currency Table'[currency_id])
Which means, the SWTICH would always go to option 1 if no selection on the slicer.
SalesTo Thirds = SWITCH ( [selected currency], 1, CALCULATE ( [CYACTUALUSDSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), 2, CALCULATE ( [CYACTUALEURSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), 3, CALCULATE ( [CYACTUALAOPCOMPARABLESCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ), CALCULATE ( [CYACTUALEURSCALEPERIOD], FILTER ( vPMA_NAM_SalesReport, vPMA_NAM_SalesReport[PMA Adjusted Hierarchy Level7] = "Sales to Thirds" ) ) )
I'm facing the same issue, how did you resolve it?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |