cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luke050
Frequent Visitor

measure: daily gain in column with filter/slicer based on different table

This is how the table binding looks like:

 

Bez tytułu1.png

 

I would like to create a measure that will calculate daily increase/decrease in the column: sessions_info[instagram_profiles_info.followers] for each sessions_info[date] 
there may be several entries for the sessions_info[date] , therefore the maximum value should be taken for each date.

another problem is that this table sessions_info has records for all profiles in instagram_profiles. and I need to plot the change for each one based on the slice selection in my visualization.  slicer based on instagram_profiles[name]

 

 

dailychange = 
    VAR yesterday=maxx(FILTER(all(sessions_info),sessions_info[Date]=SELECTEDVALUE(sessions_info[Date])-1),sessions_info[instagram_profiles_info.followers])
    return if(ISBLANK(yesterday),BLANK(),max(sessions_info[instagram_profiles_info.followers])-yesterday)

 

this is my attempt to build but it doesn't work properly.

1 ACCEPTED SOLUTION

@luke050 

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
luke050
Frequent Visitor

maybe I did not describe it well enough.

 

the measure I wrote works, but only when the sessions_info table contains data for one profile. then there is simply no need to filter and the measure calculate for all the lines.the problem occurs when I have data from other profiles. then the measure simply scrambles the data.

@ryan_mayu I think you helped me, but now the data structure has changed, and i have data for multiple profiles in one database








@luke050 

since I am not clear about your real business, could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ryan_mayu sure, maybe now it will be easier:Bez tytułu3.png

@luke050 

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@ryan_mayuThank you,thats it. i added one modification because for the first day in the model this column always returned a big jump (because your column in this case assumes yesterday was 0). so I added a simple if conditionobraz.png

glad to hear that.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors