In power bi i have 2 table
Table 1 (Total no of seats)
Venue 1 100 seats
Venue 2 150 seats
Table 2 (No of seats used)
Venue 1 40 seats
Venue 2 75 seats
I need to calculate how to many seats used
ex (40/100) *100 = 40%
Can someone helps me
**Current database i can't join these table
Try to use average function did not work
Assuming your tables look like this:
Table 1:
Venue | Total Seats
-----------------------
Venue 1 | 100
Venue 2 | 150
Table 2:
Venue | Seats Used
----------------------
Venue 1 | 40
Venue 2 | 75
Create a relationship between Table 1 and Table 2 on field Venue, then you can create a measure:
Seat Utilisation =
DIVIDE (
SUM ( 'Table 2'[Seats Used] ),
SUM ( 'Table 1'[Total Seats] ),
BLANK()
)
See https://pwrbi.com/so_55470616/ for an example PBIX file
Related
Here is my data sample, of Table "Sales"
City Items Target Sales
ABC Pen 100 20
ABC Pencil 200 40
ABC Glue 100 68
CDE Copy 50 37
CDE Books 70 20
CDE Rubber 200 156
I want a DAX query for Power BI, to count unique cities having total sales more than 50% for a large set of records with multiple Cities / States / Items
You need to iterate over the distinct values of the City field, evaluate the Sales % Target for each City, then count the number of values exceeding 50%.
Cities >50% =
COUNTX (
VALUES ( Sales[City] ),
IF (
CALCULATE (
DIVIDE (
SUM ( Sales[Sales] ),
SUM ( Sales[Target] )
)
) > 0.5,
1
)
)
I'm trying to achieve the column "Sales = Chair" in power bi. The goal is to filter value for a specific category and populate the value in the rows of the same column.
Category Subcategory Sales Sales = Chair
Furniture Chair 100 100
Furniture Sofa 150 100
Appliances Washer 250 100
Appliances Microwave 200 100
Can you try a measure like-
new_column =
CALCULATE(
SUM(your_table_name[Sales]),
FILTER(
ALL(your_table_name),
your_table_name[Category] = "Furnuture"
&& your_table_name[SubCategory] = "chair"
)
)
I would like to create measure which will calculate sum of sales orders.
I have a table:
Sales Order ID
Sales Order Item
Type
Amount
1
01
1
250
1
02
2
300
2
01
1
100
3
01
2
50
If one Sales Order has 1 and 2 type then should be calculated only type 2, when Sales Order has only one type then all value should be calculated. So in that case:
Sales Order 1 = 300
Sales Order 2 = 100
Sales Order 3 = 50
Could you please help me how can I achieve this results?
Best regards
Probably this is what you need:
SumConditional =
var __typ2 = ADDCOLUMNS( SUMMARIZE('Sheet1 (2)', 'Sheet1 (2)'[Sales Order ID]), "MaxType", CALCULATE(MAX('Sheet1 (2)'[Type]) ))
return
CALCULATE( SUM('Sheet1 (2)'[Amount]), TREATAS( __typ2,'Sheet1 (2)'[Sales Order ID],'Sheet1 (2)'[Type]) )
I am trying to create a measure that calculates (a/qty)*100 for each month,
where qty commes from Delivery table (generated with an R script)
month qty
<date> <dbl>
1 2019-02-01 1
2 2019-03-01 162
3 2019-04-01 2142
4 2019-05-01 719
And a comes from a table TABLE_A that has been created within Power BI that looks like this :
Client Date a
x 2019-03-07 3
x 2019-04-14 7
y 2019-03-12 2
So far, I managed to calculate that value overall with the following measure formula :
MEASURE = CALCULATE( (Sum(TABLE_A[a])/sum(Delivery[qty]))*100)
The issue I have is that I would need this measure monthly (i.e. join the tables on month) without explicitly defining a link between the tables in the PowerBI model.
For each row in TABLE_A you need to look up the corresponding qty in Delivery, so try something along these lines:
MEASURE =
DIVIDE(
SUM( TABLE_A[a] ),
SUMX(
TABLE_A,
LOOKUPVALUE(
Delivery[qty],
Delivery[month], EOMONTH( TABLE_A[Date], -1 ) + 1
)
)
) * 100
The formula EOMONTH( TABLE_A[Date], -1 ) returns the end of the previous month relative to that date and adding 1 day to that to get the start of the current month for that date.
I am looking for a solution of this probably simple problem. I have two tables in Power BI: Inventory and Sales:
Inventory Sales
Item Title Item Quantity
123 Soap 124 5
124 Detergent 123 8
125 Toothpaste
126 Tooth brush
How can I make a table that lists items not sold. I.e. I need to return:
Item Title
125 Toothpaste
126 Tooth brush
I would add a Measure to the Inventory table, e.g.
Item Quantity = 0 + SUM ( Sales[Quantity] )
Then I would add that Measure to the Visual level filters for your table visual, and set the filter to:
Show items when the value:
is
0
You could create a calculated column:
=IF(LOOKUPVALUE(Sales[item];Sales[item];Inventory[item]);BLANK();1)
and then filter for this column = 1
Or you could do this:
=IF(LOOKUPVALUE(Sales[item];Sales[item];Inventory[item]);BLANK();[title])
If you use this columns on your axis in a visual/table, only items not sold will show up.
Or you could use create a measure like this, assuming there is a relationship between the two tables on Item:
Products not being sold :=
IF (
ISBLANK (
CALCULATE (
DISTINCTCOUNT ( Inventory[item] );
FILTER ( Sales; Sales[item] = [item] )
)
);
1;
BLANK ()
)
if you add this measure to your visual/table only items not sold will show up