March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am working on creating a line chart for a report , and I am unsure how to model my current dataset to allow me to plot this as required.
Currently my dataset is structured like this
Dealer
Sale ID(Unique)
Sale Start (Date item went on sale)
Date Sold(Date item actually sold)
Month sold( Difference in months from sale start and date sold)
I need to alter my dataset to show the percentage of items that are sold per month number , while using a slicer to filter the start date and the dealer.
Can anyone help me with shaping this dataset ?
Hi @Arranafc19 ,
Create a calculated table first.
New table = FILTER ( CROSSJOIN ( ADDCOLUMNS ( FILTER ( CALENDAR ( DATE ( 2018, 1, 1 ), DATE ( 2019, 12, 31 ) ), DAY ( [Date] ) = 1 ), "Year-Month", FORMAT ( [Date], "MMM YYYY" ) ), Table4 ), ( YEAR ( [Date] ) > YEAR ( [Sale start] ) && OR ( YEAR ( [Date] ) < YEAR ( [Date Sold] ), ( AND ( YEAR ( [Date] ) = YEAR ( [Date Sold] ), MONTH ( [Date] ) <= MONTH ( [Date Sold] ) ) ) ) || ( YEAR ( [Date] ) = YEAR ( [Sale start] ) && MONTH ( [Date] ) >= MONTH ( [Sale start] ) && OR ( YEAR ( [Date] ) < YEAR ( [Date Sold] ), ( AND ( YEAR ( [Date] ) = YEAR ( [Date Sold] ), MONTH ( [Date] ) <= MONTH ( [Date Sold] ) ) ) ) ) ) )
Add below measure and corresponding fields from 'New table' into line chart.
percentage = DIVIDE ( COUNT ( 'New table'[Sale Id] ), CALCULATE ( DISTINCTCOUNT ( 'New table'[Sale Id] ), ALLSELECTED ( 'New table' ) ) )
Best regards,
Yuliana Gu
thank you for the below explanation , however it is not quite what I was looking for.
I need to be able to group the month sold column and get a percentage of total sales per month. Not all records have a date sold so the idea is to get a percetnage per month of how many actually sold.
The idea for this graph is that I can use the slicer to filter the sale start date, and then my chart would give me a percentage per month sold , from month 1 upwards
Hope this makes sense
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
92 | |
86 | |
77 | |
49 |
User | Count |
---|---|
166 | |
149 | |
99 | |
73 | |
57 |