cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anand_developer
Frequent Visitor

showing wrong value instead of Default Value from Slicer

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"))
)

 

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft
Microsoft

@Anand_developer

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"
        )
    )
)

 

View solution in original post

2 REPLIES 2
Eric_Zhang
Microsoft
Microsoft

@Anand_developer

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"
        )
    )
)

 

Anonymous
Not applicable

I'm facing the same issue, how did you resolve it?

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors