Hello, I Have been using power bi visualization tool for a while to do some basic visualization. I am trying to get better at dax and
power query and I came accros this task. I tried to solve it but I wasnt sucessful. any help would be appreciated. The details about the problem is below
We are an organisation in the fitness industry. We have employed athletes as "Fitness Trainers" who train our clients.
Operations cycle is as follows -
Details about data (attached is excel files):
Field | Remarks |
pack_id | Unique identifier of pack purchased by client |
client_id | Client unique identifier |
pack_size | Size of package purchased |
date_purchased | Date of purchase |
paid | Whether the package has been paid for (1 = paid, 0 = not paid) |
paid_date | Date of payment |
Field | Remarks |
client_id | Client unique identifier |
trainer_id | Trainer unique identifier |
date_training | Date when session is conducted |
time_training | Time when session conducted (in UTC) |
pack_id | Pack from which session conducted |
status_session | Status of session – · Pending – Booked but pending to be confirmed by trainer · Confirmed – Booked and confirmed by trainer · Completed – Conducted · Cancelled(Trainer/Client)-Not Charged – Cancelled and not charged from the client’s package · Cancelled(Trainer/Client)-Charged – Cancelled and charged from client’s package |
type_session | Free = these are demo sessions not considered for trainer commission calculation Paid = Considered for trainer commission calculation |
session_rating | Star rating given by client for the session |
Commission structure is as below –
1 Base commission
Base commission for the first 15 sessions are reduced while calculating commissions – i.e. not paid to the trainer (initially new sessions are reduced and if enough new sessions are not available, reduction is done from renewal sessions)
2 Star rating bonus / penalty
3 Bonus based on total sessions
A bonus scheme is applicable as follows based on total no. of conducted sessions during a month (reduction does not affect this) –
AED 2,000 for 81 – 90 sessions
AED 2,500 for 91 – 100 sessions
AED 3,000 for 101 – 120 sessions
AED 3,500 for 121 – 150 sessions
AED 5,000 for > 150 sessions
Sessions conducted from unpaid packages are not considered for commission calculation
This is historical data from the start of business.
To do:
The data is too big so I modified it a little bit
https://docs.google.com/spreadsheets/d/1T1aZ5zVOhTPPqAIb8Y-PsqY1onMnDjaH/edit?usp=sharing&ouid=11345...
Solved! Go to Solution.
Hi @TAZ95 ,
What does your expected result look like?
If you want to filter based on month and ID, you can use slicers.
Slicers in Power BI - Power BI | Microsoft Learn
In Power Query, you can use the group by feature.
Grouping or summarizing rows - Power Query | Microsoft Learn
In DAX, learn about FILTER function to apply custom filter.
FILTER Function in DAX and Power BI: Apply Custom Filter to Calculations - RADACAD
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TAZ95 ,
What does your expected result look like?
If you want to filter based on month and ID, you can use slicers.
Slicers in Power BI - Power BI | Microsoft Learn
In Power Query, you can use the group by feature.
Grouping or summarizing rows - Power Query | Microsoft Learn
In DAX, learn about FILTER function to apply custom filter.
FILTER Function in DAX and Power BI: Apply Custom Filter to Calculations - RADACAD
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.