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

How to show data from 2 columns in 1 chart with option

Hi everyone,

 

I have a question regarding demonstrating data in PoweBI Desktop. I hope you can support me.

 

Currently i have a dashboard wich connect different tables from an excel file and there is one page which relate to an excel file: employment_rate. There are 04 main columns: Location, YTD, Previous month, month of previous year.

 

I have created a clusterred column chart which show location and YTD. Now i want a solution/ button/ filter that contain information of Previous month, month of previous year so that when i choose Previous month than instead of 1 column at the moment i will have 2. And when i choose also month of the previous year i can have 03 columns.

 

Thank you very much for your supporting!!

 

1 ACCEPTED SOLUTION

Hi @Doris Check below video. Shall be helpful if I undersood the requirement correctly.

 

https://www.youtube.com/watch?v=gYbGNeYD4OY

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Doris ,If you have date. Then using time intelligence and date calendar you can these easily, example given below

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))


last QTR same Month (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,Qtr))))


MTD (Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date])))
MTD (Last Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH),"8/31")))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Hi @amitchandak , thank you for your fast reply but actually i dont have to calculate it, those columns are already there and whenever i try to put 03 in the same chart than i have 03 columns (YTD, previous month, month of previous year) but i want to have the option that those 02 columns (previous month, month of the privious year are shown only when i select).

 

 

 

Hi @Doris Check below video. Shall be helpful if I undersood the requirement correctly.

 

https://www.youtube.com/watch?v=gYbGNeYD4OY

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

 

@AnkitBIthis seems to be what i need, i will try to apply and let you know the result.

Thanks a lot!😀

 

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.