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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
king76
Frequent Visitor

Filter several values, how?

Hello,

 

I'm using a piece of code I found on the Internet that works very well, which allows me to display the number of records added cumulatively on a graph: 

graphique.png

 

Instead of displaying the total of all records, I want to display a curve for each activity area. I don't know in my formula how to filter against another field (activity).

 

The formula : 

 

data =
CALCULATE (
     COUNTX(Users,[date]),
     FILTER (ALL('User (by date)'[date]), 'User (by date)'[date] <= MAX('User (by date)'[date])
     )
)

My USERS table contains a DATE field and an ACTIVITY field
The other table USER (By date), it's a copy of my USER table which contains only dates.

 

Can you help me?

 

Thanks

 
 
1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Could you specify a bit more what do you mean by " I want to display a curve for each activity area"?
Do you mean you want to have a running total calculation for each activity? If that is what you are trying to do you can add the "activity" field either to legend or small multiples part of your line graph. Also for running totals without YTD I recommend using the following structure: 

RT with selected time period =
 
var _edate = MAX('Calendar example'[Date]) return
CALCULATE(SUM('Quarter calculations'[Value]),
'Calendar example'[Date]<=_edate,ALL('Calendar example'))
//You can replace sum with count if that is what you need
 
 

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
king76
Frequent Visitor

Ohhh thank you it was so easy finally!

 

legende.png

 

 

Have a nice day

ValtteriN
Super User
Super User

Hi,

Could you specify a bit more what do you mean by " I want to display a curve for each activity area"?
Do you mean you want to have a running total calculation for each activity? If that is what you are trying to do you can add the "activity" field either to legend or small multiples part of your line graph. Also for running totals without YTD I recommend using the following structure: 

RT with selected time period =
 
var _edate = MAX('Calendar example'[Date]) return
CALCULATE(SUM('Quarter calculations'[Value]),
'Calendar example'[Date]<=_edate,ALL('Calendar example'))
//You can replace sum with count if that is what you need
 
 

 





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

Proud to be a Super User!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors