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
BugmanJ
Resolver I
Resolver I

Unable to build simple line graph

Morning All,

Trying to build a simple line graph. I have 3 years worth of data from 4 different shops showing how many cartridges where sold. All I want is simple line graph with every day running along the bottom and number up the side. I should have 4 different lines.

PowerBI constantly wants to give me an aggregate of the data.

 

I have built a calander table and linked it, told X axis to be continuous and it just gives me a blank screen. I have also told the number of sales not be summed.

 

Other more expensive packages handle this just fine, why can't powerbi be as easy? What is being missed?

 

As an additional bonus, I tried to create a simple measure of cartridge sales x2 and yet it tells me a single value cant be determined because its not aggregated. But i dont want the data to be aggregated.

 

Link to google drive:
https://drive.google.com/file/d/1iqV9MQqcgr5JJ9jywoxhkewLqxSMZRl6/view?usp=sharing

 

Thank you

1 ACCEPTED SOLUTION

I was eventually able to solve this myself.

 

1) Ensure that the Date in your original data set and the date in your calander table match exactly down to the same format

2) Create a fake column, I called mine "QT" and put a 1 value in it

3) Create a measure, "SUMX (TABLENAME,TABLENAME[FIELD],*TABLENAME[QT]) or in my instance:
sumx(ShopData,ShopData[Cartridges]*ShopData[QT])

Place both Date and New Measure on graph and presto, done!. Sometimes if you have more then one entry for the day, you will have to think how best to handle this, I chose average and reworked the above to be 
averagex(ShopData,ShopData[Cartridges]*ShopData[QT])

Maybe one day this will be easier!

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

"I have built a calander table and linked it" - the relationship is not working due to the values in Shop Data.  They have time portions in them.  Remove the time portions OR  create another column with only the date portion and use that in the relationship and on the axis.  You can do this in Power Query from the interface.

Date table to Shop Data should be one-to-many with date table filtering one-way.

----

Powerbi is all about aggregations.  You will have to learn how to use this to your advantage.  Even if there is only one value per day, some visuals require an aggregation (for example, sum) and, when using this you'll begin to see the power (that means you can get results at day/week/month/year for example, as long as there is a hierarchy in the date table)

Hello @HotChilli 

 

Sorry but this doesn't work

1) Created "Realdate column" (Realdate = FORMAT('Shop Data'[Date],"MM-DD-YYYY")

2) Ensured that Date flows to Realdate as a one to many with one way flow

2) Put "RealDate" on X Axis. Changed to continous (Putting "date" from Datetable still gives blank despite this is what a calander date table is supposed to be used for)

 

It gives a line grahp but gives COUNT. I dont want any aggregation, I just want the graph to show the amount of sales for each show for that day. Dont get me wrong, I understand what the package can do, but its not this. Other packages (Tableau) can do this so simply, why not PowerBI? 

Fresher Powerbi Uploaded
https://drive.google.com/file/d/1iqV9MQqcgr5JJ9jywoxhkewLqxSMZRl6/view?usp=sharing

 

I was eventually able to solve this myself.

 

1) Ensure that the Date in your original data set and the date in your calander table match exactly down to the same format

2) Create a fake column, I called mine "QT" and put a 1 value in it

3) Create a measure, "SUMX (TABLENAME,TABLENAME[FIELD],*TABLENAME[QT]) or in my instance:
sumx(ShopData,ShopData[Cartridges]*ShopData[QT])

Place both Date and New Measure on graph and presto, done!. Sometimes if you have more then one entry for the day, you will have to think how best to handle this, I chose average and reworked the above to be 
averagex(ShopData,ShopData[Cartridges]*ShopData[QT])

Maybe one day this will be easier!

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.