Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Display Month-wise and YTD data in one visual

Hi Guys,   I am trying to display month-wise and  YTD data in one visual, which I am not able to do it now. Is there any provision to do this in Power BI? I have attached a sample snapshot with th...
  • v-frfei-msft's avatar
    7 years ago

    Hi Anonymous ,

     

    Please check the following steps as below.

     

    1. Create a calculated table and relat it to the fact table like this.

    YM = UNION(VALUES('Table'[Year]),VALUES('Table'[Month]))

     

    2. Then we can create a measure to get the excepted result as we need.

     

    Measure = var a = SUM('Table'[value])
    return
    IF(ISBLANK(a),CALCULATE(SUM('Table'[value]),USERELATIONSHIP('Table'[Year],YM[Year])),a)

     

    For more details, please check the pbix as attached.