Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SayeeHarsha
New Member

Summarize Measures from different Tables into a Single column and derived custom column from the Res

Hi All,

 

We have 4 different Measures from 4 different Tables (Sales, Revenue, Invoice, Demand).

Our requirement is to derive a final Measure along with a Custom column that segregates the final value into 3 different categories.

Eg : Final Sum = Sales + Revenue + Invoice,

then Final Table should be  Final Sum - Demand (Table).

Categories are divided based on the final Table value as provided below for your reference : 

 

Power BI_Community_Reference_Data.png

Please reach out for any further information. 

Thank you !!

1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @SayeeHarsha ,

Please follow these steps:
1. The table datas and model view as follows.

vzhouwenmsft_0-1706250703471.png

vzhouwenmsft_1-1706250720995.png

vzhouwenmsft_2-1706250740912.png

vzhouwenmsft_3-1706250760732.png

vzhouwenmsft_5-1706250867138.png

2.Use the DAX expression shown to create a measure named ‘ FinalSum-Demand ’.

 

FinalSum-Demand =
CALCULATE (
    (
        SUM ( Sales[Column2] ) + SUM ( Revenue[Column2] )
            + SUM ( Invoice[Column2] )
    )
        - SUM ( Demand[Column2] )
)

 

3.Use the DAX expression shown to create a measure .

 

Measure = 
var _a=[FinalSum-Demand]
var _b=SWITCH(
                    TRUE(),
                        _a = 0 , "Final Sum Equal Demand",
                        _a< 0 , "Final Sum < Demand",
                        _a> 0 , "Final Sum > Demand")
return
_b

 

4.Final output

vzhouwenmsft_0-1706251218089.pngvzhouwenmsft_1-1706251234728.png


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @SayeeHarsha ,

Please follow these steps:
1. The table datas and model view as follows.

vzhouwenmsft_0-1706250703471.png

vzhouwenmsft_1-1706250720995.png

vzhouwenmsft_2-1706250740912.png

vzhouwenmsft_3-1706250760732.png

vzhouwenmsft_5-1706250867138.png

2.Use the DAX expression shown to create a measure named ‘ FinalSum-Demand ’.

 

FinalSum-Demand =
CALCULATE (
    (
        SUM ( Sales[Column2] ) + SUM ( Revenue[Column2] )
            + SUM ( Invoice[Column2] )
    )
        - SUM ( Demand[Column2] )
)

 

3.Use the DAX expression shown to create a measure .

 

Measure = 
var _a=[FinalSum-Demand]
var _b=SWITCH(
                    TRUE(),
                        _a = 0 , "Final Sum Equal Demand",
                        _a< 0 , "Final Sum < Demand",
                        _a> 0 , "Final Sum > Demand")
return
_b

 

4.Final output

vzhouwenmsft_0-1706251218089.pngvzhouwenmsft_1-1706251234728.png


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@SayeeHarsha , You need to create a new measure

 

m1=

var _new= ([Sales]+ [Revenue]+ [Invoice])- [Demand]

return

Switch(True(),

_new >0 , "Final Sum > Demand",

_new <0 , "Final Sum < Demand",

"Final Sum equal Demand"

)

 

 

if you need slicer, do Dynamic Segmentation

 

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.