cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Dynamic field according to date

I have two calculation formulas, to discover a user's adherence.

 

I want to find a way, that ...

 

If you select only one month in my data segment it will return the column "% Peso Aderência Limite"

 

But if I want to view from January to July, in this case more than a month, I would use the calculation "SUM([Realizado])/SUM([Previsto])"

 

How could i do that ?

 

Screenshot_3.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Dynamic field according to date

@Gabrielm97 , Refer

measure =
var _min = minx(allselected(Date),Date[Date])
var _max = maxx(allselected(Date),Date[Date])
var _diff = datediff(_min,_max,month)
return
if(_diff <=1 ,[% Peso Aderência Limite],SUM([Realizado])/SUM([Previsto]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Dynamic field according to date

@Gabrielm97 , Refer

measure =
var _min = minx(allselected(Date),Date[Date])
var _max = maxx(allselected(Date),Date[Date])
var _diff = datediff(_min,_max,month)
return
if(_diff <=1 ,[% Peso Aderência Limite],SUM([Realizado])/SUM([Previsto]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper I
Helper I

Re: Dynamic field according to date

Many many thanks!!

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors