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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

「構成比 * 値」の計算について

区分ごとに表示した数値があり、メジャーで区分ごとの構成比を作成しています。さらに
数値と構成比率を掛け合わせた数値をメジャーで算出していますが
下記に記載のようになっています。
※区分はAのほかにBやCもあります。

 

本来であれば算出値の合計「37」が表示されるはずですが、
どのようなDAX式を記載すればよいでしょうか。


▼×(現在)

区分する算出値
10101
1010%1
3030%9
5050%

25

合計100100%

100


▼〇

区分する算出値
10101
1010%1
3030%9
5050%

25

合計100100%

37

 

※使用しているメジャーは以下の通りです。

 

%= DIVIDE([合計]、CALCULATE([合計]、ALLEXCEPT( 'table1'、 'table1' [type]))、0)

 

計算値= [合計] * [%]

 

 

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

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

f1.png

 

Then you may create two measures as below.

 

% = 
DIVIDE(
    SUM('Table'[Value]),
    CALCULATE(
        SUM('Table'[Value]),
        ALL('Table')
    )
)

Result = 
SUMX(
    'Table',
    [%]*'Table'[Value]
) 

 

 

Result:

f2.png

 

Best Regards

Allan

 

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-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

f1.png

 

Then you may create two measures as below.

 

% = 
DIVIDE(
    SUM('Table'[Value]),
    CALCULATE(
        SUM('Table'[Value]),
        ALL('Table')
    )
)

Result = 
SUMX(
    'Table',
    [%]*'Table'[Value]
) 

 

 

Result:

f2.png

 

Best Regards

Allan

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.