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
Freddus
Regular Visitor

Need help presenting a comparable Line graph with 4 different lines

Hi, 

 

I need help to create a Line Graph with four different report (4 sheets). I have done a appended query so the 4 sheets are combined. However, each report have different date periods so the line graph will be inconsistent. How can I form the data so that the X-axis show only last 30 values or similar in order to make a comparable graph. 

 

Please let me know if you need furhter information. Help very much appreciated. 

 

Rgrds, Fred

1 ACCEPTED SOLUTION
cs_skit
Resolver IV
Resolver IV

there is multiples solutions 

you could combine the 4 tables by this:

 

Modeling - New Table

 

Merged4Books = UNION
(
TOPN(30;Table1;Table1[Date];DESC);

TOPN(30;Table2;Table2[Date];DESC);

TOPN(30;Table3;Table3[Date];DESC);

TOPN(30;Table4;Table4[Date];DESC);

)

 

or alternatively you can add sorted index by date to the source and then join on that so the most current date is 1 the day before 2 and so on

theres other possibibilities but for that I would need to see the data

View solution in original post

7 REPLIES 7
cs_skit
Resolver IV
Resolver IV

there is multiples solutions 

you could combine the 4 tables by this:

 

Modeling - New Table

 

Merged4Books = UNION
(
TOPN(30;Table1;Table1[Date];DESC);

TOPN(30;Table2;Table2[Date];DESC);

TOPN(30;Table3;Table3[Date];DESC);

TOPN(30;Table4;Table4[Date];DESC);

)

 

or alternatively you can add sorted index by date to the source and then join on that so the most current date is 1 the day before 2 and so on

theres other possibibilities but for that I would need to see the data

Thank you. Brilliant, I appreciate it. 

 

I used the first alternative. 

 

So the next crux. I don't want it to ignore null values. What can I do about that? 

 

Thanks, 

Fred

Null values of what? Is date Null???

 

The merge should give you 30 rows per table does not matter if some field in rows is blank.

What is the problem? maybe give some screenshot of the Chart or Data???

I can give you a snap shot of the column that I am comparing in the graph. sfoc.PNG 

 

However, I am comparing Fuel Consumption and for some dates, the values are 'n/a'.  The graph is adding up the values instead of leaving it as zer value, see graph Powerbi data.PNG

 

 

 

 

 

still don't get it that graph is strange what do you want to have instead of zero

 

tell me what you want your result to be

 

you can use IF ISBLANK

Never mind. Got it to work. 

 

Thanks for the help, I appreciate it. 

Hi @Freddus,

 

Have you achieved the original requirement? If so, would you please kindly mark the corresponding reply as an answer or share your solution so that it can benefit more people? 

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then 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.