Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have the numbers of customers of two months and want to show the average.
This visual is the sum of customers with code:
customer[count_no] = IF(ISBLANK(customer[name]),BLANK(),1)
For the average I tried a measure:
Does anyone have an idea what is wrong with my measure?
Thank you
Solved! Go to Solution.
hi @lost_flower
try like:
count_AVG =
VAR _AverageTable =
ADDCOLUMNS (
VALUES ( 'Date'[Date].[Month] ),
"count",
CALCULATE(COUNT ( customer[count_no] ))
RETURN
AVERAGEX( _AverageTable, [count] )
hi @lost_flower
try like:
count_AVG =
VAR _AverageTable =
ADDCOLUMNS (
VALUES ( 'Date'[Date].[Month] ),
"count",
CALCULATE(COUNT ( customer[count_no] ))
RETURN
AVERAGEX( _AverageTable, [count] )
Awesome! It works. Thank you so much 🙂
Tell us more about how you use this measure. Do you use a slicer?VALUES ( 'Date'[Date].[Month] ) seems you want to calulcated the average within a monthy group.
Can you show the underlaying data for a given example, please. It is very difficult to understand the probem.
Do you check the interaction between slicer and bar chart?
Proud to be a Super User!
yes, date (year and month) is used as a slicer, that also change the measure.
354 is always the sum of the selected months.
My data looks like:
Does that help?
yes, date (year and month) is used as a slicer, that also change the measure.
354 is always the sum of the selected months.
My data looks like:
Netamount | Month | Year | Clientno | Date | name | customer |
10,00 | 1 | 1993 | 2534 | 01.01.1993 | customer 1 | 1 |
20,00 | 1 | 1993 | 3475 | 01.01.1993 | customer 2 | 1 |
20,00 | 1 | 1993 | 3475 | 01.08.1993 | ||
30,00 | 1 | 1993 | 5866 | 01.06.1993 | customer 4 | 1 |
30,00 | 1 | 1993 | 2735 | 01.02.1993 |
Does that help?
Why you add VALUES ( 'Date'[Date].[Month] ) in your DAX? Date and customer table have a relationship?
Proud to be a Super User!
Hi,
yes, they have. table "date" is my calender table.
I used VALUES, because it does work for another table. Happy to know how it could work with something else
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |