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
Bopps
Frequent Visitor

Average Days Traded for Regions

Hi there, 

 

Please help 🙂

 

I need to get the average days traded by region in my dashboard. 

 

Previously I used to distinct coiiunt the days that each terminal traded anfd then export to excel and average per region. This has become tedious as i now ahve multiple countries with multiple regions,

 

I am still a newbie to this asll so I attempted to right something to help, the below still returns the average days per terminal, which is great, but now I need this to return per region. 

 

Days Traded Dax =
SUMX (
SUMMARIZE (
'Sales by TPM',
'Sales by TPM'[TPMNUMBER],
"Days Traded", DISTINCTCOUNT ( 'Sales by TPM'[DATE] )
),
[Days Traded]
)
 
Bopps_0-1620631289102.png

 

 

Bopps_1-1620631303141.png

 

1 ACCEPTED SOLUTION

Perhaps this measure is what you want...

 

Average Days per Terminal =
VAR _UniqueTerminalDays =
SUMMARIZE('Sales by TPM',
'Sales by TPM'[TPMNUMBER],
'Sales by TPM'[DATE]
)
VAR _Numerator = COUNTROWS(_UniqueTerminalDays)
VAR _Denominator = COUNTROWS(VALUES('Sales by TPM'[TPMNUMBER]))
VAR _Result = DIVIDE(_Numerator, _Denominator)
RETURN
_Result

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Bopps , You can try a measure like

 

AverageX (
SUMMARIZE (
'Sales by TPM',
'Sales by TPM'[region],
"Days Traded", DISTINCTCOUNT ( 'Sales by TPM'[DATE] )
),
[Days Traded]
)

 

 

correct the table name for region

Thanks, ive tried this. 

 

It seems to be returning the maximum though, the full number of days in the month. 

 

Bopps_0-1620634942288.png

 

I pulled the data into excel to see the true average, 

 

Bopps_1-1620634964647.png

 

 

Average for April 2021 should be 27,35

 

Not sure what isnt working? 

 

Could this be that the terminal is appearing for multiple products? 

This should matter becuase we are doing disticnt count for that terminal for the day? 

Perhaps this measure is what you want...

 

Average Days per Terminal =
VAR _UniqueTerminalDays =
SUMMARIZE('Sales by TPM',
'Sales by TPM'[TPMNUMBER],
'Sales by TPM'[DATE]
)
VAR _Numerator = COUNTROWS(_UniqueTerminalDays)
VAR _Denominator = COUNTROWS(VALUES('Sales by TPM'[TPMNUMBER]))
VAR _Result = DIVIDE(_Numerator, _Denominator)
RETURN
_Result

Thanks Paul, 

 

Ill give this a try too,

 

I had a work around that gave the aqverage dayts traded by subsituting the summarise from regions to by Termninal. 

 

A bit slower but is working 🙂 

 

You guys are amazing!! 

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.

Top Solution Authors