Is there a way to dynamically display/hide columns - apache-superset

Is there a way to dynamically display/hide columna bases on JINJA conditionals or anything similar?
So there is a SQL Editor query that I have converted to a dataset that is supposed to do some SUMs and output for example revenue per months however, I also have date filtration on top of it so then if I want to track 10 months of results by having those columns, if the filter is only for the last 2 months those results will come out empty.
If necessary and/or is unclear, I can attach images to exemplify what I mean.

Related

Comparing data for a month across a choice of 2 different years using slicers in Power BI

I am trying to create a tab in Power BI that includes a Year to Year Comparison for a month using a slicer on a date hierarchy, but I'd like the user to be able to chose which years are being compared (for future-proofing the report). This involves using 3 slicers on the report - 2 for the choice of 2 years, and 1 for the month of interest. I haven't yet found a way to get the data to show up for the graph I want.
I created a mock page that displays the type of report I'm looking for, but it only has a month slicer, and utilizes built-in page filters to constrain the years:
Reference image for what I'd like the graph to look like
What I'd like to create is a page with the filter options shown here, but it's not outputting any data, much less anything like the first graph (unless I have both year slicers to be the same):
Has the slicer options I want, but data doesn't show
I've looked into including some Time-Intelligent DAX functions, but from what I can tell, nothing seems to be an obvious solution for what I'm trying to do.
Start with two measures - one each for year 1 and 2 - to show the data for those years, and two unrelated slicer tables driving the year selection. Each measure can then pick up its year value (via SELECTEDVALUE) to use for data filtering.

Using multiple IF/AND statements to look at a query table and display a Yes/No result

I'm attempting to write a formula for excel that will look at 3 different columns of data in a query table that I'm pulling from my teams sharepoint site. I'm trying to have a Yes/No result given.
The formula I've written so far is
=IF(AND(ISTEXT(Governance_Master_List__2[Is the check c]="Yes")+(AND(ISTEXT(Governance_Master_List__2[Merged Month and Year Due]="January 2023")+(AND(ISTEXT(Governance_Master_List__2[Frequency]="Weekly")))))),"Yes","No")
So, In this example I want the formula to look at [Is the check c] for a "Yes", then Look at the [Merged month and year due] for January 2023, and then look at [Frequency] for "Weekly", and if all 3 of those are met to show the result of Yes onto another worksheet.
So far the formula isn't throwing an error when making it, but it only returns the No result, even when I ensure that all the Weekly, January 2023 entries are showing as Yes.
I'm very new to excel in terms of formulas and am learning as I go. I feel like, because the refernce query table i'm looking at has tons of different values (eg, the frequency has weekly, 6 monthly, monthly, quarterly etc and that there are 12 months to choose from) that the formula is stopping because its looking at and not ignoring those other options, hence the constant false result.
I've tried the following variations with no result..
=IF(AND(ISTEXT(Governance_Master_List__2[Is the check c]="Yes")(AND(ISTEXT(Governance_Master_List__2[Merged Month and Year Due]="January 2023")(AND(ISTEXT(Governance_Master_List__2[Frequency]="Weekly")))))),"Yes","No")
=IF(AND('Imported data'!C1:C200="Weekly")+(AND('Imported data'!E1:E200="January 2023")+(AND('Imported data'!H1:H200="Yes"))),"Yes","No")
=IF(AND('Imported data'!C1:C200="Weekly")(AND('Imported data'!E1:E200="January 2023")(AND('Imported data'!H1:H200="Yes"))),"Yes","No")
The output excel sheet is to show our quarterly compliance reporting, i'm simple trying to automate the process of entering the data into that report, as the teams use a sharepoint list to enter their compliance tasks.
Anyone have a suggestion on how I can get this working? Eventually it'll be used to populate a number of different yes/no report cells based on the relevant month and frequency of the check.

'OR' Filtering on Columns in PowerBI

I've got an oddly set up google sheet as my data source for a powerBI dashboard. Right now my main stress point is a 'last 7 days' filter that needs to be applied. The problem is that there are multiple columns containing dates that could be in the last 7 days, in this case representing multiple steps in an email chain.
If any one of those columns contains a date in the last 7 days, then I need to capture the row in most of my visualizations and tables, but if I just use standard filters, PowerBI assumes 'AND' and displays none of the rows, since there will almost never be a row where multiple date entries are in the last 7 days.
I'm almost certain there is a way to do this with either merged columns or calculated fields, or maybe there is even something as simple as an 'OR' filter, but thus far my googling has not turned up anything. Do you know a work around for this?
Thanks in advance!
In Power Query Editor, create a duplicate column for each of your date fields.
Make sure each of the duplicated columns is in Date format and then calculate the "Age". You will get a time value. In the Transform pane, use the "Duration" function and convert to "Days". Do this for each of the duplicated columns.
Now the last step: Create a "conditional column" in the "Add column" pane, and pull all of these new columns that should now have integer values and set the condition to show "Yes" if less than or equal to 7, "No" if more than 7.
Let me know if this helps.

Power BI Table w/ Slicer Where Other Columns Adjust Parameters Based Off Selection

I have the following Power BI table example for an operating expense report that uses a slicer to filter the first column named "Actual". This is to see the operating expenses for one month compared to the budget figures for the year. It also compares the year-to-date and annual figures. How can I create dynamic columns that change based on the slicer selection? These additional columns are not shown in the pic below but included in the last pic. The Budget column below was just created as an example to show what it should look like.
I set up a star schema with several tables shown below. There's only one expense fact table used and the slicer only works for the first column as previously stated but I need all the other columns to use different parameters and adjust based off what's selected in the slicer. The last image is an overview of the info and the parameters for each column. I tried creating new columns with measures for the budget to see if I can get that going but can't figure out how to make it adjust with the slicer selection.
I'm not sure if I should be using separate queries for each column or can this be done using the one expense table. Hope this isn't too confusing. Please let me know if more info is needed.
If I understood what you wanted correctly I think I solved your problem.
I was able to create the following:
I did not use all values since I did not want to type everything, if you provide some test data it is easier to replicate you dashboard.
This matrix (so not table) allows you to filter for Date (if you so desire, you can always show all date's in the matrix) Book and AccountTree.
The way this is done is by putting the address column in the ROWS for the matrix, Putting the Date column in the COLUMNS of the matrix and putting your values (actual, budget, variance) in the values of the matrix.
For the date is used days, since it was easier to type. You can always use weeks, months, quarters or years.
For this to work you have to create the following relationships:
Hope this helps.
If not, please provide test data so it is easier to try and solve your problem.

Quicksight not showing months with no data (null?)

My visual's x-axis is Date, aggregated by month, and the y-axis is total sales (sum of costs). For some months, I had no sales, but Quicksight ignores these and only shows me the months that do have data in them, even though I want the exact number of months that I specify in my time range parameter.
So, when I ask to show the last 12 months, Quicksight shows me only 4, since for the other 8 I don't have any records.
How can I make those months show as 0, instead of being excluded altogether?
---------- EDIT (possible solution) --------------
Since my analysis relied on selecting a specific product code and only getting the sums for that, I took off the filter, and instead used a calculated field of:
sumIf(sales, productCode = $productCodeParam$).
I imagine this approach works on really small datasets too if you want to use sumIf and list all of your categories there, but otherwise, by omitting data with filtering you have nothing to result in 0, since Quicksight doesn't evaluate sum(null + null) into 0.