Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am trying to get distinct key running count based on product Type. where the end date must take from date slider and start date should be static to first day in date table even though user adjust the start date. uploaded pbix & Excel files with sample data & business expecations scenarios in below link:
Any help is much appreciated !!
Thank you
Solved! Go to Solution.
Hi @Anonymous ,
Believe that your data is not correctly calculated since if you look only at 36528 you have the lines below:
3 of the lines are before January 15 and you have two distinct ProductKEY in your summary you are presenting only 1 so if you can confirm the data on the filtered data would be great.
Regarding your issue believe you would be better serve using a before slicer that way people would not be abble to change the start date but having this has you have you can write your measure in the following way:
Distinct key Running count =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Product Key] );
FILTER (
ALL ( 'Table'[Invoice Date] );
'Table'[Invoice Date] <= MAX ( 'Date'[Date] )
);
USERELATIONSHIP ( 'Date'[Date]; 'Table'[Invoice Date] )
)
When you making a reference to the entire table has you have previously the context picks up all the line values and all the columns so when you take out some columns from your data you will get 9 for every single row. This has to do with the use of measures and their context.
One further question if you activate the relationship there is no need for the use relationship, and if you use that with the before slicer there isn't a need for a measure you can use the column Product Key directly.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Anonymous ,
Believe that your data is not correctly calculated since if you look only at 36528 you have the lines below:
3 of the lines are before January 15 and you have two distinct ProductKEY in your summary you are presenting only 1 so if you can confirm the data on the filtered data would be great.
Regarding your issue believe you would be better serve using a before slicer that way people would not be abble to change the start date but having this has you have you can write your measure in the following way:
Distinct key Running count =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Product Key] );
FILTER (
ALL ( 'Table'[Invoice Date] );
'Table'[Invoice Date] <= MAX ( 'Date'[Date] )
);
USERELATIONSHIP ( 'Date'[Date]; 'Table'[Invoice Date] )
)
When you making a reference to the entire table has you have previously the context picks up all the line values and all the columns so when you take out some columns from your data you will get 9 for every single row. This has to do with the use of measures and their context.
One further question if you activate the relationship there is no need for the use relationship, and if you use that with the before slicer there isn't a need for a measure you can use the column Product Key directly.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêsyes, its 2 unique product keys. i twisted a logic little bit and worked as i expected.
Thanks you Miguel, you are awesome !!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
99 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
105 | |
86 | |
72 |