The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Please think of a simple sales data model with appropriate facts and dimensions ( I can share a dummy model if needed).
Dimensions include a Products table, Date table, Stakeholders table, and Salesperson table having information about Salesperson, their city, facility, and Organization.
Facts is a Sales table with foreign keys and is a star schema.
Client wants slicers such that if they select a number between 2 and 10, my report should show data of those 'Organizations' which made sales between 2 and 10M$ in selected time period.
For that, I created a disconnected What-If parameter table using generate series.
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, 1 , 0 )
I have a Sales by Org chart and in that chart. I added this DAX measure to visual level filter of this chart and it works fine. The data is restricted and the numbers match. If I select a row from this chart, it will filter out other visuals KPIs, Profits by Products etc. But the client wants this functionality without having to manually select a row in my Sales by Org chart.
Please guide or suggest workarounds.
Solved! Go to Solution.
@LazyUser , all you measures to created like this or filter this in visual level filter for non blank
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, 1 , blank() )
example of measures needed in table
New sales=
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, [Total sales] , blank() )
count of organizations
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
sumx(values(Table[Organization]) ,IF([Total sales] > _min && [Total sales] < _max, 1 , blank() ))
@LazyUser , Use what if parameter or generateseries of table and try measures like
Total sales = SUM(Sales)
then create a new measure
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, 1 , 0 )
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
Hi @amitchandak I did the same and used this measure in a chart which shows Sales by Organization and I got the right result.
If I select all the Organizations from this widget, then every other widget (KPIs, Widgets using other dimensions such as Products) on the dashboard gets filtered out.
Client wants this latter functionaity too without having to manually select the organization from the filtered chart.
Edit: I get it why it was not clear from my initial question, editing it now. Sorry for the confusion!
@LazyUser , all you measures to created like this or filter this in visual level filter for non blank
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, 1 , blank() )
example of measures needed in table
New sales=
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
IF([Total sales] > _min && [Total sales] < _max, [Total sales] , blank() )
count of organizations
New measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = maxx(allselected(whatif),whatif[value])
return
sumx(values(Table[Organization]) ,IF([Total sales] > _min && [Total sales] < _max, 1 , blank() ))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
79 | |
78 | |
44 | |
38 |
User | Count |
---|---|
150 | |
116 | |
68 | |
64 | |
58 |