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
ivancespedesl
Helper I
Helper I

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

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
v-lili6-msft
Community Support
Community Support

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.

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.

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.

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.