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.
Hi all,
I am new at Power BI but I want to built a mixed graph: a line and a bar.
But the line should not react on the slicer, and the bar should react on the slicer.
See my example below:
This is my table with info
Week code | In_base |
202046 | 120.800 |
202045 | 119.050 |
202044 | 117.300 |
202043 | 115.550 |
202042 | 113.800 |
202041 | 112.050 |
202040 | 110.300 |
202039 | 105.000 |
202038 | 100.000 |
202037 | 95.000 |
202036 | 90.000 |
202035 | 80.000 |
202034 | 75.000 |
And I would like to built the graph as below. So when I use the slicer on week code, the line should stay as is, but the bar should change:
Can anyone help me out on this?
Thanks very much!
Solved! Go to Solution.
Hi, @Anonymous
As mentioned by @amitchandak ,you need to create a dimension table of week code and establish a relationship with the fact table
Slicer Table = DISTINCT(SELECTCOLUMNS('Table',"Week code",'Table'[Week code]))
Create the following measure and aplply it to the "line value" of chart.
Bar value = CALCULATE(SUM('Table'[In_base]),ALLEXCEPT('Table','Table'[Week code]))
The result will show as below:
Best Regards,
Community Support Team _ Eason
Hi, @Anonymous
As mentioned by @amitchandak ,you need to create a dimension table of week code and establish a relationship with the fact table
Slicer Table = DISTINCT(SELECTCOLUMNS('Table',"Week code",'Table'[Week code]))
Create the following measure and aplply it to the "line value" of chart.
Bar value = CALCULATE(SUM('Table'[In_base]),ALLEXCEPT('Table','Table'[Week code]))
The result will show as below:
Best Regards,
Community Support Team _ Eason
Please consider this solution and leave feedback …
Try using 2 calendar tables.
One for the sliders and one for the graph x axis.
Then create 2 measures
Block graph qty =
SUM(Sales[Qty])
Line graph qty =
CALCULATE(SUM(Sales[Qty]),
ALL(SlicerCalendar)
)
@Anonymous , the best way to do is to have an independent table with Week and use that in the slicer. Create a measure (for the bar) that uses this filter
measure = calculate(sum(Table[in_base]), filter(Table, Table[Week code] in allselected(week[week])))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |