Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Issues with Calculation Groups and Field Parameters

Hi Power BI wizards,
I have created a sample visuals using sample dataset of Power BI
The KPI is a field parameter which is using Sales measure and Profit measure.

Sales_ = SUM(financials[ Sales])
Profit_ = SUM(financials[Profit])
 
The Parameter filter is also a field parameter refrencing table columns.
Parameter = {
    ("Month Name", NAMEOF('financials'[Month Name]), 0),
    ("Year", NAMEOF('financials'[Year]), 1)
}
 
and lastly I've created Calculation Group with two calculation items
Sales = SELECTEDMEASURE()
YTD =
IF(
    NOT (ISINSCOPE(Parameter[Parameter Fields])),
    TOTALYTD(
        SELECTEDMEASURE(),
        DATESYTD(TBL_Date[Date])
    )
)
 
The Required Visual is 2 and what I'm getting is 1, meaning in the calculation of YTD there is a  repeation of the months. The same happens when I click on month Name , is there a way to avoid it and just show YTD?
 

 


 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Can you provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

     

     

    Best Regards,

    Jayleny

    • Anonymous's avatar
      Anonymous
      Not applicable

       Hi,
      most of the upload links are blocked from my organization if you see the screenshot attched with the question, I have numbered the two tables. I'm getting the 1, but the required visual is 2.