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
Anonymous
Not applicable

Histogram with group values but iterable with slicer

Hello,

 

I have the following table and I need to build an histogram to interact with a date slicer but before I have to make the following calculation:

 

IDDateSales
101/01/202110
101/02/20215
201/01/202123
201/02/202142
201/03/20212
301/01/202144
401/01/20216
401/02/20219

 

Calculation: Sum of result the agrupation values by ID, and then build the histogram with the column "Sales" grouped. I  have tried to do it with a group by, but it generates a table that is not interacting with the date slicer that I have. I would need to get something like the following and be able to pass it as a column to the histogram:

 

Slicer: 

Dates between 01/01/2021 and 01/02/2021

 

IDSales
115
265
344
415

 

Thanks!

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @FinYui8 

Thanks for reaching out to us.

You can try this measure

Measure = 
var _eachrow= CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[ID]=MIN('Table'[ID])))
var _total= CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table'))
return IF(ISINSCOPE('Table'[ID]),_eachrow,_total)

vxiaotang_3-1649060003483.png

Or you can select Sum for that column,

vxiaotang_1-1649059932236.pngvxiaotang_4-1649060033128.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @FinYui8 

Thanks for reaching out to us.

You can try this measure

Measure = 
var _eachrow= CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[ID]=MIN('Table'[ID])))
var _total= CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table'))
return IF(ISINSCOPE('Table'[ID]),_eachrow,_total)

vxiaotang_3-1649060003483.png

Or you can select Sum for that column,

vxiaotang_1-1649059932236.pngvxiaotang_4-1649060033128.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks for the reply. Yes, I have done different tests, and the one you have given me, but as I said, the histogram only accepts one column as input values, it does not accept measurements. Thank you anyway. 

Hi @Anonymous 

Thanks for your reply. You can use this visual, it accepts measure as values,

vxiaotang_1-1649238102605.pngvxiaotang_0-1649238084500.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the 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.