The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Greetings, all! I'm attempting to calculate a running total for a disconnected table and am hoping someone can help me out. Here's a sample scenario.
Let's say I have the following tables (model below):
I'm wanting to get a running total/count of the Events table and then "categorize" them dynamically.
Date | Person | EventType |
10/1/2022 | Max Jones | Webinar |
10/1/2022 | John Smith | Webinar |
10/1/2022 | Jane Doe | Webinar |
10/2/2022 | Jane Doe | Webinar |
10/3/2022 | Matthew Hicks | Webinar |
10/3/2022 | Margaret Johnson | Conference |
10/3/2022 | Regina Ortiz | Conference |
11/13/2022 | Max Jones | Webinar |
11/13/2022 | John Smith | Conference |
12/1/2022 | Jane Doe | Webinar |
12/1/2022 | Max Jones | Conference |
12/1/2022 | John Smith | Conference |
12/5/2022 | John Smith | Conference |
The Category table has the following values:
Order | Value |
1 | High |
2 | Medium |
3 | Low |
I need to get a "subtotal" count of the events and then apply a "category" to them using the following logic:
SWITCH(true, {RunningTotalEventCount} >= 4, "High", {RunningTotalEventCount} >= 2, "Medium", "Low")
I then want to show this in a visual like the following:
The issue is ALL of this needs to be done in a measure because it needs to change when a person slices/dices. Been working on this for a few hours and am about near my wit's end.
Hope all of this made sense. Appreciate it!
Hi @arpost ,
I have created a simple smaple, please refer to it to see if it helps you.
Create a column first.
month = MONTH('Table'[Date])
Then create a measure.
Measure = var _1=
CALCULATE(COUNT('Table'[EventType]),FILTER(ALL('Table'),'Table'[EventType]=SELECTEDVALUE('Table'[EventType])&&'Table'[month]=SELECTEDVALUE('Table'[month])))
return
IF( _1>= 4, "High",IF(_1>= 2, "Medium", "Low"))
Or a column.
Column = var _1=
CALCULATE(COUNT('Table'[EventType]),FILTER(ALL('Table'),'Table'[EventType]=EARLIER('Table'[EventType])&&'Table'[month]=EARLIER('Table'[month])))
return
IF( _1>= 4, "High",IF(_1>= 2, "Medium", "Low"))
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.