Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Community,
I have a slicer based on disconnected table that includes values A, B, C, D.
I have a table with transactional data that stores values A, B, C and D in separate columns.
Requirement is to create an new measure, let's call it F, that is going to return A, B, C, D OR sum of any combination of those columns.
I have created F as
Solved! Go to Solution.
The best approach would probably be to unpivot the columns A, B, C, and D so that you avoid writing this sort of measure entirely.
If they have to be separate columns, try this:
F =
VAR SelectedValues = VALUES ( DisconnectedTable[DisconnectedTable] )
RETURN
IF ( "A" IN SelectedValues, SUM ( [A] ) )
+ IF ( "B" IN SelectedValues, SUM ( [B] ) )
+ IF ( "C" IN SelectedValues, SUM ( [C] ) )
+ IF ( "D" IN SelectedValues, SUM ( [D] ) )
The best approach would probably be to unpivot the columns A, B, C, and D so that you avoid writing this sort of measure entirely.
If they have to be separate columns, try this:
F =
VAR SelectedValues = VALUES ( DisconnectedTable[DisconnectedTable] )
RETURN
IF ( "A" IN SelectedValues, SUM ( [A] ) )
+ IF ( "B" IN SelectedValues, SUM ( [B] ) )
+ IF ( "C" IN SelectedValues, SUM ( [C] ) )
+ IF ( "D" IN SelectedValues, SUM ( [D] ) )
@Anonymous Probably want something like:
F =
VAR UserSelections = DisconnectedTable[DisconnectedTable]
VAR __SumA = IF("A" IN UserSelections),SUM(A),BLANK())
VAR __SumB = IF("B" IN UserSelections),SUM(B) + __SumA,__SumA)
VAR __SumC = IF("C" IN UserSelections),SUM(C) + __SumB,__SumB)
VAR __SumD = IF("D" IN UserSelections),SUM(D) + __SumC,__SumC)
RETURN
__SumD
Hey @Greg_Deckler !
Thanks for your input! I think it is a very good approach.
There is one challange with the sollution you have suggested.
VAR UserSelections requires a single value for column in the DisconnectedTable. Do you have any suggestions how to work it around? I'm not able to use the Max/Min aggregation as it will pick up only one value from the slicer.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |