cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ivancespedesl Regular Visitor
Regular Visitor

Changing column graph displayed value and getting measures out of it

Hi,

I want to get a "macro-graph" where I have all the variables inside it. I did it creating a new table ('Value') following this formula:

 

Measure =
IF(HASONEVALUE( 'Value'[Value]),
SWITCH(VALUES('Value'[Value]),
"Ingresos_Mes", AVERAGE('Clientes Mac'[Ingresos_Mes]),
"Sal_Cons_TC", SUM( 'Clientes Mac'[Sal_Cons_TC] ),
"Sal_Cons_CC", SUM( 'Clientes Mac'[Sal_Cons_CC])
), "Choose a value")


However, now I want to make measures out of this measure such as MoM%, Average over time, etc. Mostly time intelligence measures. The measure really doesnt understand time, or maybe my formula is wrong. For example, MoM% is the following:

MoM% =
IF(
    ISFILTERED('Clientes Mac'[Date].[Month]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __PREV_MONTH = CALCULATE([Measure], DATEADD('Clientes Mac'[Date].[Date], -1, MONTH))
    RETURN
        DIVIDE([Measure] - __PREV_MONTH, __PREV_MONTH)
)

Any suggestions are accepted.
 
 
Thanks in advance,
 
IC
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Changing column graph displayed value and getting measures out of it

hi, @ivancespedesl 

The problem is that there is no row context in this visual. So it could understand the time variables.

So .could you please share a simple sample data and your expected output. so that I could give you a further help.

 

Best Regards,

Lin

 

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

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Changing column graph displayed value and getting measures out of it

hi, @ivancespedesl 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

If possible, please share a simple sample pbix file.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ivancespedesl Regular Visitor
Regular Visitor

Re: Changing column graph displayed value and getting measures out of it

Hi,

 

Using this code I was able to create a variable that gives me this output:

image.png

image.png

This allows me to get the totals and graphs depending on the selection as I want to be presented:

image.png

 

However, Im having problem making measures as Average, MoM%, etc. I think the problem is that it does not understand the time variables, therefore, does not calculate properly.

 

What I want to do is to create measures as Average, MoM% that work for every variable selected so I want to do this calculations specifically to the variable Measure.

 

Any other info you need, Im at your service.

Community Support Team
Community Support Team

Re: Changing column graph displayed value and getting measures out of it

hi, @ivancespedesl 

The problem is that there is no row context in this visual. So it could understand the time variables.

So .could you please share a simple sample data and your expected output. so that I could give you a further help.

 

Best Regards,

Lin

 

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

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors