The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All,
I am a beginner in DAX and I am trying to figure out how to achieve the following using either a calculated column or a measure.
Requirement:
Find the
the calculated column in a table is not dynamic - it is populated only when the table is refreshed. So Measure4 is always filtering the same A records
you could create a temporary one using ADDCOLUMNS in your Measure4
I could help you write it if you post some example (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).
Column1 | Column2 |
A | 1 |
B | 2.5 |
Hi Stachu,
Did you get a chance to look into the sample data?
Thanks
@Stachu wrote:the calculated column in a table is not dynamic - it is populated only when the table is refreshed. So Measure4 is always filtering the same A records
you could create a temporary one using ADDCOLUMNS in your Measure4
I could help you write it if you post some example (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).
Column1 Column2 A 1 B 2.5
Dimension:
Product | |||
Product no | Product name | Quantity On hand | ID |
Ar45 | Gloves | 113.5 | 1 |
Tu78 | Cap | 26.7 | 2 |
Fu07 | Hat | 25000 | 3 |
Bx12 | Coats | 0 | 4 |
Wv89 | Socks | 300.4 | 5 |
Re65 | Shirts | 100.6 | 6 |
Fact:
Usage | ||
ID | Month First Date | Quantity Used |
1 | 01/01/19 | 1.5 |
1 | 02/01/19 | 0.2 |
1 | 03/01/19 | 5.6 |
1 | 02/01/19 | 1.2 |
2 | 03/01/19 | 0.9 |
2 | 02/01/19 | 0.02 |
2 | 01/01/19 | 2.2 |
2 | 05/01/19 | 0 |
2 | 03/01/19 | 3.6 |
3 | 05/01/19 | 0.005 |
3 | 02/01/19 | 0.06 |
3 | 04/01/19 | 3.4 |
3 | 07/01/19 | 5.2 |
3 | 03/01/19 | 1.2 |
4 | 06/01/19 | 9.8 |
4 | 02/01/19 | 5.7 |
5 | 04/01/19 | 0.06 |
6 | 06/01/19 | 2.6 |
6 | 05/01/19 | -1.9 |
6 | 03/01/19 | -2.5 |
Month range Selected | Measure 2 | Measure 3 | ||
01/01/2019 to 05/01/2019 | Jan 2019 to May 2019 | 150 | 30 |
Output | ||||
Product no | Product name | Quantity On hand | Measure 1 | Calculated Column 1 |
Ar45 | Gloves | 113.5 | 8.5 | 0.09 |
Tu78 | Cap | 26.7 | 6.72 | 0.03 |
Fu07 | Hat | 25000 | 4.67 | 35.69 |
Bx12 | Coats | 0 | 5.7 | 0 |
Wv89 | Socks | 300.4 | 0.06 | 33.38 |
Re65 | Shirts | 100.6 | -4.4 | -99 |
# Of Products |
2 |
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
8 | |
7 |