Line Graph in Power BI - powerbi

Two-line graph with slicers: Everything looks fine until date selections are made.
I figure that this failure has something to do with the line graph and date functionality. Date selections work together in a very weird way. Selecting only 2019 months and then only 2020 months, both lines disappear.
If the date slicers are going to work together, I should expect inclusive behavior, rather than "NOT 2020 AND NOT 2019"!
See relationships.
How do I get the behavior intended on one two-line graph?
Thanks!

I agree with #teylyn, sometimes less is more.
The problem is how Power Bi works and how your measures are calculated. You have two averagex-measures, both pointing to same date table. In Power BI, two separate filters from a single dimension can't do "union", they are laid down on top of each other. You are telling that first I want to filter by 2019 November and after the filter has been evaluated, you tell that you want to filter 2020 January. Power BI adds new filter to already filtered dataset, but the dataset doesn't contain anything that match both filters, so the end result is empty.
One way to get around this problem is to create separate date-tables for filtering purposes for blue and green. Here is an example of the data model needed:
Then you update the date-filters in second tab. Set blue date filter to one date-dimension and green date filter to another. This way they aren't filtering the same table and the graph should work the same as before.

Related

Looking for results between selected dates and before in power bi

I have a dashboard with two slicers. First slicer is selecting stages of building homes ( trench, frame, roof etc) second slicer is end date time. Both slicers are using the fields exist in the same table. Users want to select two stages lets say stageA and stageB, and the date selection is 12/1/2022 to 1/1/2023 now we have stages with end date time in a table view. In the future users want to see even if latest stage is within the date slicer it doesnt matter even if the earlier stage is within the date slicer or "before" they want to see it SO THAT they can look at these two date's variance! Any help would be appreciated. Thanks !
I have been looking online for one week, couldn't find any solution

power bi - get latest value based on date

one action has several situations differing on date.
I want the chart to show only the latest situation when nothing is filtered, but when the user filters another date I want the situation to adapt correctly
Image

Power BI - How to have a calculated column and place it in a merged cell?

I am new to Power BI and with the limited time given, I am stuck at how to come up with:
Below Table B-Row1 ("1/20" and "M"-Monday cell) - how to
specifically place the date measures in their specific cell and put
it in one column?
How can I merge the cells under the Total column?
How to add all the numbers from the Type1 and Type2 columns and place it in the merged cell in #2?
Any clues/direction/links on how to achieve the Target Table B below will be much appreciated.
PS. Below Table A. Current is just using Matrix Visualization in Power BI.
You can't exactly do what you are after. PowerBI allows you to rapidly put amazing visuals together however that comes at the price of lack of (easy) flexibility. You could build your own custom visual or look in App Source for a visual that does this, or build the Visual in some other tool (via custom code).
However, I'd recommend sticking with the PowerBI matrix, which will give you a cascading drill down and work out how best to align your data to it and other out of the box visuals. Once you start to delve in to convoluted work-arounds to give users data in exactly the format they request you start to burn a lot of time. Look for alternatives to tell the data's story and work with your end-user to buy in to it.
Just wanna share that I have resolved my problem not using one type of visualization, but through using 3 different visualizations in Power BI. I used:
1 Table visual for Date column
1 Table visual for Total column
1 Matrix visual for the Code+Type mapping and counts
I also used DAX function to get the Date format and another DAX function used for both Total and Code+Type counts(to filter data according to the specified date).
Thanks for the response, #Murray and #RADO.

how to ignore all slicers except date slicer and get count in power BI

I would like to get count of order number and I have multiple slicers which would slice down the value . for one calculation .I would need to ignore all the other slicers except date slicer and get the count of orders.could you please help.
If you want to ignore all the slicers, you can create a measure using the DAX function ALL. And if you want to ignore all the slicers except one, you can use ALLEXCEPT. Those two function will calculate your count based on all the values.
If you have a visual that only shows the count you are referring to, there is another way. You can stop slicers from interacting with the visual you want your count to appear on. So, you can select the slicer, go to Format and the click Edit Interactions and clik the circle (None interaction). Do the same for all slicers you don't want to affect the visual with your count.

Creating Date Relationship in Power BI for Slicers

I'd like to slice across visuals based on dates in MS Power BI (i.e., one filter for say month will slice all visuals for that time period.
I created a date table from http://www.agilebi.com.au/power-bi-date-dimension/ to link to the date columns in each table.
I connected xlsx workbook.
Image of columns in Power BI
I added tried to edit the relationship so connect the 2 date columns. However, when I insert the filter using the date_table as values and try to use it, the visuals disappear.
Visuals are Gone
However, when I create the slicer and slice across multiple visuals, they go blank.
**I tried changing the type to "Both" but it didn't fix the problem.
The script at AgileBI.com.au creates a date table with a 'Date' field that has a data type of text. You can (surprisingly) do a relationship between 2 fields of different data types and not get an error. However, a join between a text field that contains dates, and a regular date field will mean that rows that look like they should match up do not.
You can confirm this is happening by picking a value in the 2 tables that you think should match up and seeing if they are identical. In my case, I had Tuesday, November 01, 2016 in my imported table, and 11/1/2016 in the other table. While they both represent the same date (in the US), they clearly look different. A good place to see this is in the Edit Relationship screen (and it definitely would have been helpful to include a screenshot of that in your original post).
Anyway, if the dates in your table don't match up to the corresponding (text) dates in the Date table, then when you filter to "2016" on your slicer, the visuals will all go blank.
I would recommend:
Click Edit Queries
On the left hand side, select the table of dates (called Invoked Function by the script)
Click on the header for the Date column (it will likely already be selected)
Select Transform on the ribbon
Change the Data Type from Any to Date
Click Home > Close & Apply
Hope this helps.