Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Ireland111
New Member

Interactive table calculations based off of slicer selection

I'm trying to create a dynamic dataset in Power BI. What i want to do is as far as i am aware not possible in Power BI: 

I want to set a column in the query table to read in what the slicer has been selected for e.g. my formula in the query would be: 1000* slicer value. this column would then be used by subsequent columns to calculate an output. 

 

However as said everything i know about Power BI says you cannot read dynamic data into the query.

 

So what i wanted to do was create a number of measures that create a new table dataset starting from that first point e.g. have a measure running from the slicer to do the initial calculation and then adding measures to that measure to complete the rest of my calculations e.g. i want to replicate the table i would have in the query but in terms of measures.

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @Ireland111,

 

1. Create a measure that captures the slicer value:

Slicer Value = SELECTEDVALUE('Table'[SlicerColumn])

2. Create measures that use the slicer value to perform calculations:

Calculation = 1000 * [Slicer Value]

3. Use the calculated measures to perform subsequent calculations:

Final Calculation = [Calculation] + 500

 

Keep in mind that measures are calculated at runtime based on the context of the visuals they are used in. Therefore, as you change the slicer selection, the measures will automatically recalculate and update accordingly.

 

Note: Alternatively, you can also use calculated columns instead of measures if you need the dynamic calculation to be part of the data model itself rather than being calculated on the fly.

 

Let me know if you might need further assistance.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.