Forum Discussion

jishnubhattacha's avatar
6 months ago
Solved

Show maximum Yearmonth Value selected in the Dropdown.

I am working on Tableau to Power BI Migration. In one of my report I have a dropdown which showing Year Month in tableau. The Yearmonth dropdown by default is showing maximum Yearmonth value of the t...
  • mdaatifraza5556's avatar
    6 months ago

    Hi jishnubhattacha 

    As per my understanding of your requirement, could you please try the steps below?

    1. disconnected table which you have already created .
    Disconnected_YearMonth =
    DISTINCT(FactTable[YearMonth])

    2. Create a 1st measure .
    Selected YearMonth =
    VAR SelectedYM =
    SELECTEDVALUE(Disconnected_YearMonth[YearMonth])
    RETURN
    IF(
    ISBLANK(SelectedYM),
    MAX(FactTable[YearMonth]),
    SelectedYM
    )


    3.  Third measure.
    Total Sales (Selected YM) =
    CALCULATE(
    SUM(FactTable[Sales]),
    FactTable[YearMonth] = [Selected YearMonth]
    )




    If this answers your questions, kindly accept it as a solution and give kudos.