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 September 15. Request your voucher.
I am currently completely stumped on this problem I am having and am not sure if this is possible within power bi but I am trying to filter my visualization by one slicers single date value, and by entity id, test name and test type then calculate a current count by summing the count column based off of those filters. Then I would like to perform another calculation where I sum the count column again but this count would be based on a different selected single-day date value. This second count value would be capturing the selected previous period's count.
Solved! Go to Solution.
Hi @Anonymous ,
Yes, that's possible to do with Power BI. You need the following:
Some might recommend you to create an inactive relationship in the data model instead of disconnected table and use filter functions USERELATIONSHIP or CROSSFILTER. These solutions would be equally valid as long as they are complete and include two date tables. The reason I did not choose them is because they are most beneficial if you have two table, e.g. date and ledger, and two relationships between them, because then using USERELATIONSHIP would implicitly turn off the active relationship. Since we need two date tables because we want to feed two independant (not hierarchical) date slicers we need to turn off the relationship between the first date table and the ledger table explicitly in the measure code anyway.
BR
Martin
Thank you so much @Martin_D this was a HUGE help and worked the only issue I am running into now is that I cant get it to filter by the minimum selected start date. I am trying to make the second date slicer filter by a single day value by using the after filter in the date picker but cannot figure out how to then get this to be filtered down to only 1 selected days worth of data. Im not sure if you know the answer to that as well, thank you again!
The only options for a true single select date slicer are dropdown, verticle list, or tile slicer format. As a workaround with data picker you could choose the on or before setting and select only the maximum selected date in the measure like:
DifferentSelectedDateMeasureReferencingSelectedPeriodCount =
VAR _SelectedSecondDate = MAX ( 'Disconnected Date Table'[Date Key] )
... // continue with code as before, only change TREATAS line to
TREATAS ( { _SelectedSecondDate }, 'Test Ledger'[Date Key] )
...
Hi @Anonymous ,
Yes, that's possible to do with Power BI. You need the following:
Some might recommend you to create an inactive relationship in the data model instead of disconnected table and use filter functions USERELATIONSHIP or CROSSFILTER. These solutions would be equally valid as long as they are complete and include two date tables. The reason I did not choose them is because they are most beneficial if you have two table, e.g. date and ledger, and two relationships between them, because then using USERELATIONSHIP would implicitly turn off the active relationship. Since we need two date tables because we want to feed two independant (not hierarchical) date slicers we need to turn off the relationship between the first date table and the ledger table explicitly in the measure code anyway.
BR
Martin
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |