March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
i Have two fact tables joined to two dimensions tables, i am trying a dax query to return a calculated table, this dax works for one column, but i don't how to extended to the second column
EVALUATE
addcolumns(values(tag[tag]),"earned hours",mstdates[earned hour],"budget hours",mstdates[budget hours])
i want to add a new column area[area]
thanks for your help
edit : i was missing the use of cross join to related different dimensions
Solved! Go to Solution.
Hi @mim,
Is it possible for you to merge the two fact tables together into one table first in Query Editor? Then you should be able to use ADDCOLUMNS or SUMMARIZE Function (DAX) to get the result you need in this scenario.
Reference:
POWER BI DESKTOP : MERGE QUERY OPTIONS
Best Practices Using SUMMARIZE and ADDCOLUMNS
Regards
What if you create a couple of measures, to represent your facts and write something like:
evaluate(
summarize
(
'mstdates'
,'tag'[tag]
,'area'[area]
,"earned hours", [earned hour]
,"budget hours", [budget hours]
)
)
Proud to be a Super User!
summarize will work only for 1 table, at least that's my understanding, that's why, i am using addcolumns ?
Hi @mim,
Is it possible for you to merge the two fact tables together into one table first in Query Editor? Then you should be able to use ADDCOLUMNS or SUMMARIZE Function (DAX) to get the result you need in this scenario.
Reference:
POWER BI DESKTOP : MERGE QUERY OPTIONS
Best Practices Using SUMMARIZE and ADDCOLUMNS
Regards
summarize will work for on base table, but you are able to reference columns in related tables and use measures
Proud to be a Super User!
Hi,
Could you post a schema or describe how the relationships look for your tables: tag, mstdates and area?
Since Addcolumns will evaluate all expressions on each row for your "base" table, and the expression must evaluate to a scalar value the relationship from table tag to the table area should be many to one.
Does this make sense?
Br,
Magnus
I have two fact tables
fact table 1(tag, area, earned hours)
fact table 2(tag, area, budget hours)
the tags and area are not always the same in the two tables
two Master tables
tag(tag) (PK)
area(area)(PK)
i am looking to have this result
tag,area, sum(earned hours), sum(budget hours)
msdate is just a dummy table for storing measures.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
78 | |
67 | |
52 |
User | Count |
---|---|
199 | |
140 | |
96 | |
77 | |
68 |