Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I have a report that currently shows how many items were added to a database during a scan and the difference compared to the previous run. Clicking on any date in the graph changes the total findings to that date, and updates the change. If no date is selected, it defaults to the latest:
It works great, but what I would also like to do is create two other table visualizations that actually show the items that were ADDED and REMOVED between the selected scan and the previous scan, so we can see what items actually changed instead of just a count. I created this query that works ONLY for the most recent scan and the previous one to show items that were added; i.e., the data in the visualization never changes when selecting a new date:
Added =
var __selectedDate =
SELECTEDVALUE(
calculated_filtered[scanned],
MAX(calculated_filtered[scanned])
)
var __previousDate =
CALCULATE (
MAX(calculated_filtered[scanned]),
calculated_filtered[scanned] < __selectedDate
)
var __newerTable =
CALCULATETABLE(
calculated_filtered,
calculated_filtered[scanned] = __selectedDate
)
var __olderTable =
CALCULATETABLE(
calculated_filtered,
calculated_filtered[scanned] = __previousDate
)
return
EXCEPT(
SELECTCOLUMNS(
__newerTable,
"provider",[provider],
"recommendation",[recommendation],
"resourcegroup",[resourcegroup],
"resourceid",[resourceid],
"resourcename",[resourcename],
"subscription",[subscription],
"taskid",[taskid]
),
SELECTCOLUMNS(
__olderTable,
"provider",[provider],
"recommendation",[recommendation],
"resourcegroup",[resourcegroup],
"resourceid",[resourceid],
"resourcename",[resourcename],
"subscription",[subscription],
"taskid",[taskid]
)
)
I know this may not work since I'm using a Calculated Table and it may only run once, but even after selecting a date and hitting 'Refresh' it doesn't update the list so I'm not sure if I'm just doing something wrong or if there's a workaround to making something like this work. Any thoughts or help is appreciated!
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Sorry for the delay, but yes - that DAX creates a new table, and the visualizer was using columns from that (calculated?) table.
I tried the CONCATANEX you suggested, with UNICHAR to do the newline as a delimiter and it works pretty well! Surprisingly, turning Word Wrap off removes the newline row separator but it works for 'at a glance' and updates as I click on different dates of the graph visualizer as expected
However, I would still like to be able to refresh the original DAX created tables 'Added' and 'Removed', even if I had to click Refresh after selecting a date in the graph visualizer or another slicer.
I tried creating a new page, adding a table visualization pulling columns from the DAX created tables ('Added' and 'Removed') and then adding a slicer on this page with a field to the 'calculated_filtered[scanned]' column from which the 'Added' and 'Removed' tables are calculated from, and it doesn't change:
Any thoughts on how I can get the DAX created tables to update after a refresh, using a slicer which references a column used in the DAX calculation?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks, Allison, for the information on the order of operations - that helps a lot with trying to understand what's going on!
I tried poking around briefly at the parameters and I think the PowerQuery parameters may be my best bet to get a dynamically generated list of dates to use, so I will keep poking at that.
Thanks again!
You're welcome. Enjoy Power Query parameters - they're fun, and feel free to shout out if you get stuck or confused.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 35 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |