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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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