Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello I would like to know how to divide the values of two columns from two different tables using group by. Major Problem is the tables doesnt have same Date set. In the first table, the rows contains time series data but second table doesnt.
For Example:
Table1 is like:
Date Data
1.10.2019 15
3.10.2019 34
4.10.2019 35
5.10.2019 36
7.10.2019 48
8.10.2019 52
9.10.2019 21
10.10.2019 35
11.10.2019 101
12.10.2019 77
13.10.2019 104
15.10.2019 80
16.10.2019 132
18.10.2019 176
And Table2 is:
Date Data
1.10.2019 33
2.10.2019 54
10.10.2019 150
11.10.2019 201
12.10.2019 174
13.10.2019 80
16.10.2019 137
17.10.2019 169
18.10.2019 181
I'm a bit of a novice and so if anyone can help with the DAX that would be appreciated!
Solved! Go to Solution.
Hi @dethnass
try measure in Table1
Measure =
var _tbl1Val = SUM(Table1[Data])
var _tbl1Date = MAX(Table1[Date])
var _tbl2Sum = CALCULATE(SUM(Table2[Data]), Table2[Date] = _tbl1Date)
RETURN
DIVIDE(_tbl1Val, _tbl2Sum)
Hi @dethnass
try measure in Table1
Measure =
var _tbl1Val = SUM(Table1[Data])
var _tbl1Date = MAX(Table1[Date])
var _tbl2Sum = CALCULATE(SUM(Table2[Data]), Table2[Date] = _tbl1Date)
RETURN
DIVIDE(_tbl1Val, _tbl2Sum)
I am struggleing for 3 days to figure out how to solve similar case I have.
Million of Thanks👍
What's the output that you want?
Have you tried VAR function like below?
measure =
VAR value1= value from table1
VAR value2= value from table2
return divided(value1,value2)
Proud to be a Super User!
I have an also 2x measure like
table1data = SUM(Table1[Data])
table2data = SUM(Table2[Data])
And my final output code like this.
measure =
VAR value1= [table1data]
VAR value2= [table2data]
return DIVIDE(value1,value2)
When i put that measure on line chart with the date its not work properly.
As my above post i will send my sample data again:
Table1 :
Date Data
1.10.2019 15
3.10.2019 34
4.10.2019 35
5.10.2019 36
7.10.2019 48
8.10.2019 52
9.10.2019 21
10.10.2019 35
11.10.2019 101
12.10.2019 77
13.10.2019 104
15.10.2019 80
16.10.2019 132
18.10.2019 176
Table2 is:
Date Data
1.10.2019 33
2.10.2019 54
10.10.2019 150
11.10.2019 201
12.10.2019 174
13.10.2019 80
16.10.2019 137
17.10.2019 169
18.10.2019 181
Now I want to create a measure to divide each data column by its corresponding date. Please let me know. Thanks!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
62 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
83 | |
61 | |
45 | |
41 | |
39 |