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
mehaboob557
Resolver IV
Resolver IV

DAX to show average to reach version n for each quotation

Hi All,

 

I want to get reports in two scenarios,

 

             1. average versions sent to each quotateNO to reach version <1.0 

             2. average versions sent to each quotateNO to reach 2.0(i.e versions which are greaterthan(>)1.0 and lessthan(<)2.0 

 

example:

 

  1. lessthan(<) 1.0 versions

 

 

               quoteNo   |   versions

 

                  abc1             0.1

                  abc2             0.6

                  abc3             0.2

 

Total            3                0.9

=======================

Avergae version = divide( total version, total count of quotations)

                          =  0.9/3

 

same for 2nd scenario

 

Please help me how can i write dax formula  to achieve this.

 

you can find sample data in the dropbox url https://www.dropbox.com/s/ml1bbmbgfjz664y/avg%20versns.csv?dl=0

 

Please sugegst me or send me any pbix file by using my csv sample data.

1 ACCEPTED SOLUTION

Hi @mehaboob557,

 

Please check below measure formulas if they suitable for your requirement.

 

avg versions final <1 = 
DIVIDE (
    CALCULATE ( SUM ( 'avg versns'[version] ), 'avg versns'[version] < 1 ),
    CALCULATE ( DISTINCTCOUNT ( 'avg versns'[quoteNo] ), 'avg versns'[version] < 1 ),
    0
)

avg versions final 1~2 =
DIVIDE (
CALCULATE (
SUM ( 'avg versns'[version] ),
AND ( 'avg versns'[version] > 1, 'avg versns'[version] < 2 )
),
CALCULATE (
DISTINCTCOUNT ( 'avg versns'[quoteNo] ),
AND ( 'avg versns'[version] > 1, 'avg versns'[version] < 2 )
),
0
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
mehaboob557
Resolver IV
Resolver IV

Hi,

 

I have created two measure.

 

1st measure:

 total sum avg = CALCULATE(SUM('version'), ALLSELECTED('quoteNo'))

 

2nd measure:  

avg versions final = DIVIDE([total sum avg], DISTINCTCOUNT('prod_check dw_proposal'[quoteNo]))

 

Finally I got the required average verions.

 

Hi @mehaboob557,

 

Please check below measure formulas if they suitable for your requirement.

 

avg versions final <1 = 
DIVIDE (
    CALCULATE ( SUM ( 'avg versns'[version] ), 'avg versns'[version] < 1 ),
    CALCULATE ( DISTINCTCOUNT ( 'avg versns'[quoteNo] ), 'avg versns'[version] < 1 ),
    0
)

avg versions final 1~2 =
DIVIDE (
CALCULATE (
SUM ( 'avg versns'[version] ),
AND ( 'avg versns'[version] > 1, 'avg versns'[version] < 2 )
),
CALCULATE (
DISTINCTCOUNT ( 'avg versns'[quoteNo] ),
AND ( 'avg versns'[version] > 1, 'avg versns'[version] < 2 )
),
0
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.