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,
My data table is something like this:
Date | type | value |
8-3-2022 | average | 10 |
8-5-2022 | sum | 4 |
8-6-2022 | average | 6 |
8-7-2022 | sum | 4 |
I have a slicer on type where you can choose between average and sum
in my visual, when I filter by average I'd like my visual to show 8
when I filter by sum, i'd like my visual to show 8
but what I can't figure out is, in the visuals, I am limited by only choosing one aggregate. Can I get around this?
Thanks in advance.
Mike
Solved! Go to Solution.
I guess it helps to take a break and come back:
I figured out how to do it.
I created a measure:
Mod-Value = SWITCH(max(table[type]),
"average", AVERAGE(AvailResp[Value]),
"sum", SUM(AvailResp[Value])
)
PS. Looking back at my question, I poorly choose my numbers where the end result is the same answer; which may cause confusion.
I should have choose numbers such sum of 50 and 50, is 100
and average of 10 and 6, is 8
regardless, I figured it out, and it appears to be working., thanks for reading.
I guess it helps to take a break and come back:
I figured out how to do it.
I created a measure:
Mod-Value = SWITCH(max(table[type]),
"average", AVERAGE(AvailResp[Value]),
"sum", SUM(AvailResp[Value])
)
PS. Looking back at my question, I poorly choose my numbers where the end result is the same answer; which may cause confusion.
I should have choose numbers such sum of 50 and 50, is 100
and average of 10 and 6, is 8
regardless, I figured it out, and it appears to be working., thanks for reading.
should average be 16 or 13?
pls check the attachment to see if this is what you want.
Proud to be a Super User!
Average should be 8. (10+6 = 16, 16/2=8)
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
48 | |
47 |