The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm looking for a DAX formula that calculates the sum using two other tables. One table shows how often a certain code occurs. And in a dimension table is the duration of this code. In the example below you can see what my question is exactly:
Solved! Go to Solution.
Hi @brief001
Try this:
Measure =
VAR _Dur =
ADDCOLUMNS(
'Table 2',
"Dur1",
[Amount]
* ( LOOKUPVALUE( 'Table 3'[Duration], 'Table 3'[Code], 'Table 2'[Code] ) )
)
RETURN
SUMX( _Dur, [Dur1] )
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @brief001
Try this:
Measure =
VAR _Dur =
ADDCOLUMNS(
'Table 2',
"Dur1",
[Amount]
* ( LOOKUPVALUE( 'Table 3'[Duration], 'Table 3'[Code], 'Table 2'[Code] ) )
)
RETURN
SUMX( _Dur, [Dur1] )
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thank you VahidDM, this formula works exactly as hoped. 😀
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |