Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PVO3
Impactful Individual
Impactful Individual

Total average price change per category

Hello all,

 

I'm trying to create a price change dashboard, but currently I'm a bit stuck. Seems like it's a 'total' problem.

See sample file

Expected result

 

Everything is fine, except when aggregating the products to, for instance Category. 

Category

Result

Expected result

Bright

100,00%

7,74%

Dark

900,00%

100,00%

 

Here I would like the average. So for example, the average of Dark, should be 300%+0% / 3 = 100%

But this has to be calculated for each selected date in 'Date' table. See the expected result link for the full overview.

 

Edit: corrected my expected result and added expected result details

3 REPLIES 3
PVO3
Impactful Individual
Impactful Individual

Anyone has a clue what direction I should go? Any feedback is greatly appreciated.

davehus
Memorable Member
Memorable Member

Hi @PVO3 ,

 

Average is an average of the column, I'd reckon you need to replicate your logic by maybe dividing the result by row count maybe?

 

davehus_0-1661444363108.png

 

Did I help you today? Please accept my solution and hit the Kudos button.

 

PVO3
Impactful Individual
Impactful Individual

Thanks for your reply @davehus. I tried a similar approach, but I couldn't make it work.

And unfortunatly, I still can't. As you can see all the result of other visuals is changing. Tried to work around this with something like this:

VAR _Count = CALCULATE(COUNTROWS(dimProduct),ALLSELECTED('Date'))

RETURN
IF(
    HASONEVALUE(dimProduct[ProductID]),
    _Result,
    DIVIDE(_Result,_Count)
)

 

But still doesn't give the result I'm looking for. I think I need to iterate over a virtual table and do an AVERAGEX over that. Also, perhapse I need to split the measure. A seperate measure for the graph (each date) and a seperate measure for the tables. I'll keep trying to make this work.

 

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.