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

Help with dashboard

Hi everyone,

I am trying to build a dashboard with several KPIs for the company data. I am also trying to add a line and column chart on this dashboard. I have written the following measure that I am currently displaying in a card on the dashboard:

 

market_share = ((CALCULATE(SUM(Sales[Dollars]),
                    datesbetween('Calendar'[Date],
                        edate(MIN(calendar[Date]),-[selected_end_scale_value]),MAX('Calendar'[Date]))))
                        /
                (CALCULATE(SUM(Sales[Dollars]),
                          ALL(Brands[Brand]),
                        datesbetween('Calendar'[Date],
                            edate(MIN(calendar[Date]),-[selected_end_scale_value]),MAX('Calendar'[Date])))))

 

 

This measure shows the value of marketshare for a certain month year combo that is selected using a slicer on the dashboard and various other parameters selected from slicer on the dashboard.

I would like to make the line and column chart for this measure, the chart should display the last 12 data for this measure in this chart, however when I try to do that the chart only displays data for the month year combo that has been selected from the slicer, this behaviour is understandable, but I am trying to build a chart that takes the month year combo as the start date and shows values for the last 12 months. 

Here is a image of the table connections: 

tempsnip.png

 

The calendar table filters the main sales table. 

Any suggestions would help a lot.

Thanks. 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

Based on the datasheet model you provided and your measure DAX expression, you want to implement a measure that is presented forward for twelve months based on the date column of the date table selected by your slicer and placed in a column chart, right?

I created some test data and restored your measures, and I think you can create a measure based on the measure [market_share] and put it in the column chart to achieve your needs.

Here is my test data:

vyueyunzhmsft_0-1668577325087.png

To achieve this, you can first remove the inter-table relationship between the calendar table and your fact table:

vyueyunzhmsft_1-1668577351864.png

Then you can create a measure like this:

selected_end_scale_value1 =

var _date= SELECTEDVALUE(Sales[Date])

return

IF(_date>=EOMONTH([selected_end_scale_value],-12),[market_share],BLANK())

Then you can create this column chart like this and place the newly created measure:

vyueyunzhmsft_2-1668577408576.png

After that, you can confirm whether it can meet your requirements, and if there are problems, you can easily provide your sample simple data and the expected output visual style simulation for us to test.

 

Best Regards,

Aniya Zhang

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

 

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

Based on the datasheet model you provided and your measure DAX expression, you want to implement a measure that is presented forward for twelve months based on the date column of the date table selected by your slicer and placed in a column chart, right?

I created some test data and restored your measures, and I think you can create a measure based on the measure [market_share] and put it in the column chart to achieve your needs.

Here is my test data:

vyueyunzhmsft_0-1668577325087.png

To achieve this, you can first remove the inter-table relationship between the calendar table and your fact table:

vyueyunzhmsft_1-1668577351864.png

Then you can create a measure like this:

selected_end_scale_value1 =

var _date= SELECTEDVALUE(Sales[Date])

return

IF(_date>=EOMONTH([selected_end_scale_value],-12),[market_share],BLANK())

Then you can create this column chart like this and place the newly created measure:

vyueyunzhmsft_2-1668577408576.png

After that, you can confirm whether it can meet your requirements, and if there are problems, you can easily provide your sample simple data and the expected output visual style simulation for us to test.

 

Best Regards,

Aniya Zhang

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.