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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
edumach
Helper I
Helper I

Create a metric from two others

Hello guys,

I need help to solve a problem

I have a month chart, where I show the number of contacts made via whatsapp, from January to May 2022 it is a metric and after May the rule changes and it is a new metric

I would like to put in the same column chart, a single measure

 

I have a time attribute called MesFormatado and the two measures, QtyVirtualAgentLegado and QtyVirtualAgentCare, the attribute is in my calendar fact, and the measures are in my FTRequisicaoTarifa fact, Calendario and FTRequisicaoTarifa are listed by an SK.Grafic.JPG

 

2 ACCEPTED SOLUTIONS
edumach
Helper I
Helper I

@amitchandak 

Metric returned error

 

The report measure 'FTRequisicaoTarifa'[EVANEW] has a semantic or syntactic error in line 1, position 52, reported by Analysis Services: 'Calculation error in measure 'FTRequisicaoTarifa'[EVANEW]: A 'FILTER' function was used in a True/False expression used as table filter expression. This is not allowed.

 

EVANEW = calculate(FTRequisicaoTarifa[QtyVirtualAgentLega], filter(Calendario, Calendario[Data] <= date(2022,05,31)) + calculate(FTRequisicaoTarifa[QtyVirtualAgentCare], filter(Calendario, Calendario[Data] > date(2022,05,31))))

View solution in original post

Hi , @edumach 

You can try this, the "()" in your dax is wrong:

EVANEW = calculate(FTRequisicaoTarifa[QtyVirtualAgentLega], filter(Calendario, Calendario[Data] <= date(2022,05,31))) + calculate(FTRequisicaoTarifa[QtyVirtualAgentCare], filter(Calendario, Calendario[Data] > date(2022,05,31)))

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

@amitchandak 

Metric returned error

 

The report measure 'FTRequisicaoTarifa'[EVANEW] has a semantic or syntactic error in line 1, position 52, reported by Analysis Services: 'Calculation error in measure 'FTRequisicaoTarifa'[EVANEW]: A 'FILTER' function was used in a True/False expression used as table filter expression. This is not allowed.

 

EVANEW = calculate(FTRequisicaoTarifa[QtyVirtualAgentLega], filter(Calendario, Calendario[Data] <= date(2022,05,31)) + calculate(FTRequisicaoTarifa[QtyVirtualAgentCare], filter(Calendario, Calendario[Data] > date(2022,05,31))))

Hi , @edumach 

You can try this, the "()" in your dax is wrong:

EVANEW = calculate(FTRequisicaoTarifa[QtyVirtualAgentLega], filter(Calendario, Calendario[Data] <= date(2022,05,31))) + calculate(FTRequisicaoTarifa[QtyVirtualAgentCare], filter(Calendario, Calendario[Data] > date(2022,05,31)))

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

amitchandak
Super User
Super User

@edumach , a new measure

 

calculate([Metric1], filter(Date, Date[Date] <= date(2022,05,31)) + calculate([Metric2], filter(Date, Date[Date] > date(2022,05,31)) 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.