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

columns based on measure

I created a measure that compares values ​​of another measure. I need to create a column with the same values ​​as the measure and I'm stuck. 

 

Measure 1

.Variação % por Flight = 
IF(CALCULATE([.CPA];fDados[.Flight Referência] = "2017.1");DIVIDE([.CPA 2017.1]-[.CPA 2016.1];[.CPA 2016.1]);
IF(CALCULATE([.CPA];fDados[.Flight Referência] = "2016.2");DIVIDE([.CPA 2016.2]-[.CPA 2015.2];[.CPA 2015.2]);
IF(CALCULATE([.CPA];fDados[.Flight Referência] = "2016.1");DIVIDE([.CPA 2016.1]-[.CPA 2015.1];[.CPA 2015.1]);
IF(CALCULATE([.CPA];fDados[.Flight Referência] = "2017");DIVIDE([.CPA 2017]-[.CPA 2016];[.CPA 2016]);
IF(CALCULATE([.CPA];fDados[.Flight Referência] = "2016");DIVIDE([.CPA 2016]-[.CPA 2015];[.CPA 2015]);
0)))))

 

Measure 2

.Compara = IF([.Variação % por Flight] = 0;"Sem Comparativo";IF([.Variação % por Flight] < 0,1;"Melhor";IF([.Variação % por Flight];"Pior";"Igual")))

Column

.Compara Coluna 22 = SWITCH(TRUE();fDados[.Compara] = "Sem Comparativo"; "Sem Comparativo"; fDados[.Compara] = "Melhor"; "Melhor"; fDados[.Compara] = "Igual";"Igual";"Pior")

 pedido ajuda comunidade.png

 

 

 

 

 

 

Can you help?

7 REPLIES 7
Highlighted
Microsoft v-huizhn-msft
Microsoft

Re: columns based on measure

Hi @eduardo,

Based on your description, I don't reproduce your sceanrio, could you please share more details and sample data for further analysis?

In your "Compara" coumn, the TRUE() function always return ture, so all the values in column are "Sem Comparative". Please modify it as follows and check if it works fine.


.Compara Coluna 22 = SWITCH(fDados[.Compara]; "Sem Comparativo"; "Sem Comparativo";  "Melhor"; "Melhor"; "Igual";"Igual";"Pior")



Best Regards,
Angelia

eduardo Regular Visitor
Regular Visitor

Re: columns based on measure

Ty for response @v-huizhn-msft

 

I'm trying to create a visual (array or table) with values that calculate in measure.

 

The table does not accept measured as rows and so I need to transform the values into columns. I've tried several alternatives and I did not get the expected result. 😞

 

The question is: how do I transform measures into columns?

 

Column = [Measure] does not work

 

I put a template of the data here.  Can you help me?

 

eduardo

 

 

Baskar Super Contributor
Super Contributor

Re: columns based on measure

Hi,

 

 

The problem is the cal column based on measure so it will give only the last value.

 

 let me know 

 

ÿour measure .Variação % por Flight  is realted to same table or relative table ?

eduardo Regular Visitor
Regular Visitor

Re: columns based on measure

Hi @Baskar

 

ÿour measure .Variação % por Flight  is realted to same table or relative table ?

 

same table. 

 

ty eduardo

 

 

 

Microsoft v-huizhn-msft
Microsoft

Re: columns based on measure

Hi @eduardo,

Thank you for detail description, but I type your measure, it is not recognized based on your data, could you please describe your requriement, and what's mean of  measure, so that I can program column using DAX.

Best Regards,
Angelia

eduardo Regular Visitor
Regular Visitor

Re: columns based on measure

@v-huizhn-msft


hello and happy new year.

I give up and changed all project. Ty by your interest

 

best regards
eduardo

Microsoft v-huizhn-msft
Microsoft

Re: columns based on measure

Hi @eduardo,

Got it. Have a nice day.

Best Regards,
Angelia

Helpful resources

Announcements
New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,913)