Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Dear community members,
I have a problem. I know that a part of the solution will be a calculated column, but I have no clue how to define it...
For each client we have a budget_volume and budget_unit, in other words, a certain number of hours, minutes, days, dayparts etc. But when I receive the invoice from my supplier, the the invoiced_unit is often not the same as the budget_unit. So I have a problem with making e.g. Budget vs Actual visuals.
Does anyone how I can make a correct calculated column, that says:
when budget_unit is the same as invoiced_unit, please state the invoiced_volume
when budget_unit is not the same as invoiced_unit, than:
I attached a sample pbix to this post... https://we.tl/t-lNVA729jnT
Hope to hear soon from you.
Best regards, Sander
Solved! Go to Solution.
Hi @Anonymous ,
Please correct me if I wrongly understood your question.
You want to compare Budget_unit and Invoiced_unit to decide the return value .
If the content of Invoiced_unit is same with Budget_unit , return Invoiced_volume .
If the content of Invoiced_unit is different with Budget_unit , Subject to Budget_unit and calculate Invoiced_volume , return the calculation result.
Column = SWITCH(TRUE(),'Table'[Budget_unit]="minutes" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]*60,
'Table'[Budget_unit]="hours" && 'Table'[Invoiced_unit]="minutes",'Table'[Invoiced_volume]/60,
'Table'[Budget_unit]="day parts" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]/4,
'Table'[Budget_unit]="days" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]/8,
'Table'[Budget_unit]='Table'[Invoiced_unit],'Table'[Invoiced_volume]
)
The effect is as shown:
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please correct me if I wrongly understood your question.
You want to compare Budget_unit and Invoiced_unit to decide the return value .
If the content of Invoiced_unit is same with Budget_unit , return Invoiced_volume .
If the content of Invoiced_unit is different with Budget_unit , Subject to Budget_unit and calculate Invoiced_volume , return the calculation result.
Column = SWITCH(TRUE(),'Table'[Budget_unit]="minutes" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]*60,
'Table'[Budget_unit]="hours" && 'Table'[Invoiced_unit]="minutes",'Table'[Invoiced_volume]/60,
'Table'[Budget_unit]="day parts" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]/4,
'Table'[Budget_unit]="days" && 'Table'[Invoiced_unit]="hours",'Table'[Invoiced_volume]/8,
'Table'[Budget_unit]='Table'[Invoiced_unit],'Table'[Invoiced_volume]
)
The effect is as shown:
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous This works perfect! Thank you!
You can try following steps
1. As I understand its required to generate both numbers in same unit so that they can be compared
2. Created 2 new columns using following formula
Regards,
Sayali
If this post helps, then please consider Accept it as the solution to help others find it more quickly.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |