The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
Data like this:
creates a matrix like this;
and when ckicked a table like this:
I want to create a measure that counts the IDs 2 or 3 for the different date and stage, so I can visualise it like this:
In DAX I can use the following code, but struggle how to define the VAR selected_ids dynamically. I tried to use VALUES on the [ID], but it selects alll the possible IDs.
Thanx!
@WJ_WJ , Try if this solution can help
Power BI Partial Interactions, Selectively pass filter across visuals - https://youtu.be/SFEKQEic_sk
Thx for your reply, but Im looking for a fully DAX solution. Should be possible...
I'm not sure why you'd always want just id 2 and 3, you could use a slicer for a dynamic selection but if you want it hardcoded try:
Test =
VAR _table = FILTER('stagesTbl',
'stagesTbl'[id] = 2 || 'stagesTbl'[id] = 3)
RETURN
COUNTX(_table, COUNT('stagesTbl'[id]))
Thx for the reply. I dont want it hard copied. An this is sample data, a slicer would show to much IDs in the real data. I tried to use the select all option for a slicer, but it selects all the know IDs, not only the one for a specific date and stage...
I'm a bit confused as that seemed to be what you were asking for in your original post? If you want to filter by date and stage can't you just add slicers for those?
The idea is that the orignal table gets filter by date and stage. For a specific date and stage, 1,2 of 3 row will get selected. The IDs in these row are unique. Now I want to visualise (count) the number of those IDs for each date and stage.
For example: the filter stage = 2 and month = August wil return 2 rows with ID 2 and 3. Now I want to count these IDs (2 or 3) for each stage and date, like:
Hi, I created a sample data set based on the small table in your post. I created 2 disconnected tables based on that in order for this to work, see below:
I added these columns in to slicers adn then used the following measure:
You can select multiple dates and stages and it should still work, I believe this is as you wanted. Let me know if you have any issues or further questions.