Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Avg-Based on New Measure

Hi Team,

 

I have two tables like With Markets and Without Markets,

 

With markets table -> combination of Markets & Code 
without Markets -> Only code combination

 

Measures : (New Measures)
Stock, PO, DIM, VAT

With Markets values are fine, same I'm expected Without markets.

 

 

Thanks,

KV's

3 Replies

  • Hey Anonymous ,

     

    it's difficult, at least for me, to provide any guidance. It is not clear what you expect, meaning what's wrong with the 2nd table.

     

    It's also no clear, if both tables are "just" visuals one without the markets columns, meaning both visuals are created using the same table from your data model.

     

    Most of the time unexpected results on aggregated data (neglecting detail) are due to leaf level based algorithms, e.g. units * price eq revenue. To overcome this you have to use table iterator functions like SUMX.

    measure = 
    SUMX(
        '<tablename>'
        , '<tablename>'[units] * '<tablename>'[price]
    )

     

    Consider creating a pbix file that contains sample data, but still reflects your data model. Upload the file to one drive or dropbox and share the link. If you are using Excel to create the sample data share the xlsx as well.

     

    Hopefully, this provides some ideas on how to tackle your challenge.

     

    Regards,

    Tom 

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi Anonymous ,

     

    Not clear about your model and expected output. But from the subject of your post, if you want to get an average based on your measure, try the formula like this:

     

    Avg-Based on Measure = 
    AVERAGEX(
        ALLSELECTED('Table'[Code]),
        [Measure]
    )

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi Anonymous ,

     

    Does your problem have been solved? If it is solved, please mark a reply which is helpful to you.

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

     

    Best Regards,
    Winniz