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.
Hi, I'm having trouble finding the correct measures that show the # difference and % difference between 2 values.
In this scenario each ID is 1 person and the ID Left is the total of them leaving the company:
Month | ID | ID Left |
April | 4554 | 1 |
April | 4354 | 0 |
April | 4446 | 0 |
April | 4678 | 1 |
May | 4112 | 1 |
May | 4132 | 1 |
May | 4333 | 1 |
May | 4589 | 1 |
June | 4871 | 0 |
June | 4999 | 0 |
June | 4989 | 0 |
June | 4078 | 1 |
I need to show it as a table like below:
Month | ID | ID Left | Difference | % |
April | 4 | 2 | 50 | 50% |
May | 4 | 4 | 100 | 100% |
June | 4 | 1 | 25 | 25% |
How can I do this, please?
Thanks in advance
Solved! Go to Solution.
Hi @RichOB
Try below dax
I hope i answered your question!
Hi, you can try created below measures and add them in table.
ID_Count = distinctcount(ID)
ID_left = sum(ID_left)
Difference % = [ID_left] / [ID_Count ] *100
please let me know if this your expectation.
Hi @Uzi2019 , @Ankur04 ,Thank you for your quick reply, I will add more.
Hi @RichOB ,
Try this.
_Timeline = COUNT('Table'[Timeline])
_Planned = COUNTX(FILTER('Table','Table'[Planned] = 1),[Timeline])
Difference = DIVIDE([_Planned],[_Timeline])
If your column names change, edit here.(Replace 'Table' with your own table name)
Final output
Hi, you can try created below measures and add them in table.
ID_Count = distinctcount(ID)
ID_left = sum(ID_left)
Difference % = [ID_left] / [ID_Count ] *100
please let me know if this your expectation.
Hi, thanks for your help!
How would that measure look if the column headers changed to this, please? I tried to replicate but I couldn't get it.
Month | Timeline | Planned |
April | 4554 | 1 |
April | 4354 | 0 |
April | 4446 | 0 |
April | 4678 | 1 |
May | 4112 | 1 |
May | 4132 | 1 |
May | 4333 | 1 |
May | 4589 | 1 |
June | 4871 | 0 |
June | 4999 | 0 |
June | 4989 | 0 |
June | 4078 | 1 |
Hi @Uzi2019 , @Ankur04 ,Thank you for your quick reply, I will add more.
Hi @RichOB ,
Try this.
_Timeline = COUNT('Table'[Timeline])
_Planned = COUNTX(FILTER('Table','Table'[Planned] = 1),[Timeline])
Difference = DIVIDE([_Planned],[_Timeline])
If your column names change, edit here.(Replace 'Table' with your own table name)
Final output
Hi @RichOB
Try below dax
I hope i answered your question!
Hi @RichOB
Try below dax
I hope i answered your question!
Hi, Thanks for your help!
How would that look if the column headers changed to the below, please?
Month | Timeline | Planned |
April | 4554 | 1 |
April | 4354 | 0 |
April | 4446 | 0 |
April | 4678 | 1 |
May | 4112 | 1 |
May | 4132 | 1 |
May | 4333 | 1 |
May | 4589 | 1 |
June | 4871 | 0 |
June | 4999 | 0 |
June | 4989 | 0 |
June | 4078 | 1 |
User | Count |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |